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

InStreamStream positioned anywhere; only the head bytes matter

Return values

mifUnknownThe signature matches none of the supported modern formats, or the stream is Nil or shorter than two bytes
mifAVIFAVIF file type box brand
mifHEIFHEIF file type box brand
mifJPEGXLJPEG 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