Skip to main content

detect_standard_format

Function detect_standard_format 

Source
pub fn detect_standard_format(data: &[u8]) -> Option<StandardFormat>
Expand description

Detect a standard image format from the first bytes of image data.

Note: TIFF-based RAW formats (DNG, ARW, NEF, CR2) share the TIFF magic bytes and will be detected as StandardFormat::Tiff. Use [RawFile::open()] to distinguish RAW formats first.

Returns None if the format is not recognised or if data is too short.