PeachImage

PeachImage

ImageInfo Struct

Lightweight image dimensions/format info obtainable without decoding full pixel data.

public readonly record struct ImageInfo : System.IEquatable<PeachImage.ImageInfo>

Implements System.IEquatable<ImageInfo>

Constructors  
ImageInfo(int, int, PixelFormat, string, bool, bool, bool, bool, bool, bool, ImageOrientation, bool, Nullable<ExifLocation>) Lightweight image dimensions/format info obtainable without decoding full pixel data.
Properties  
ExifLocation The raw EXIF GPS values, when the EXIF names any. See ExifLocation.
FormatName The name of the format that produced this info, e.g. "jpeg".
HasAlpha Whether the source actually carries an alpha channel — see HasAlpha.
HasLocation Whether the file’s metadata says where it was taken: GPS tags in EXIF or XMP, or a place named in IPTC. Only jpeg, png, webp, tiff, gif, avif and jxl sources are examined (false for every other format), and nothing is examined when SkipMetadata is set. See HasLocation.
HasPreview Whether decoding can surface a lower-fidelity preview before the full image is ready, through PreviewAvailable: a JPEG XL preview frame, the passes of an interlaced PNG, or the scans of a progressive JPEG. false for every other source.
Height The image height in pixels.
IsAdobeInvertedCmyk JPEG/Adobe-specific: whether a direct-CMYK source stores its samples in Adobe’s inverted convention (255-x). Always false for non-JPEG formats and non-CMYK JPEGs. Relevant to KeepAdobeCmykInverted — by default, a full decode de-inverts these bytes back to the standard CMYK convention regardless of this flag.
IsAnimated Whether the source is a multi-frame animation. For an animated source, Load(Stream, DecoderOptions) would decode only its first frame (see IsAnimated) — use AnimatedImage to decode every frame.
IsLosslessEncoding Whether the source’s pixel data was encoded losslessly by its original codec, so a caller can avoid silently re-encoding an already-lossy source under a full-fidelity assumption. Semantics are format-specific: ...
IsYcck JPEG/Adobe-specific: whether a 4-component source is really YCCK under the hood (Adobe APP14 transform=2) rather than direct CMYK. Always false for non-JPEG formats and non-YCCK JPEGs. Relevant to DecodeRawYcck — by default, a full decode converts YCCK to CMYK regardless of this flag.
Orientation The orientation recorded in the file’s metadata (EXIF, or the format’s own equivalent), or Normal when there is none. It is informational: decoders never apply it, so Width, Height and the decoded pixels are always as stored.
PixelFormat The pixel format a full decode would produce.
Width The image width in pixels.
Methods  
GetRequiredBufferSize(DecoderOptions, int) The bytes DecodeInto(ReadOnlySpan<byte>, Span<byte>, ImageMetadata, int) needs for this image (as Identify(Stream, DecoderOptions) reported it) under options, which set the scale, orientation and pixel format of the output. Rows sit rowStride bytes apart, 0 meaning tightly packed; the last row needs no padding.