DetermineModernImageFormat
Image handling, capability discovery
Description
Sniffs the container format of a modern image stream
Up to the first 4096 bytes are inspected for the AVIF and HEIF ftyp brands and the JPEG XL codestream or container signature; the stream position is saved and restored, so the caller can keep reading from where it was
Syntax
Delphi
Function DetermineModernImageFormat(InStream: TStream): TPDFlibModernImageFormat;Parameters
| InStream | Stream positioned anywhere; only the head bytes matter |
|---|
Return values
| mifUnknown | The signature matches none of the supported modern formats, or the stream is Nil or shorter than two bytes |
|---|---|
| mifAVIF | AVIF file type box brand |
| mifHEIF | HEIF file type box brand |
| mifJPEGXL | JPEG XL codestream or container signature |
Remarks
The AddModernImageFromStream entry points run the same sniff before decoding; call this directly to build a provider pipeline that only routes modern formats to the backend
See also
ModernImageFormatName, DecodeModernImageToPNG, AddModernImageFromStream, ModernImageCodecAvailable