Skip to main content

sniff_image_format

Function sniff_image_format 

Source
pub fn sniff_image_format(head: &[u8]) -> Option<&'static str>
Expand description

Identify an image by its leading bytes. Returns a short format name (for the status line) or None if the bytes are not a supported image. Content-based only — never guesses from a file extension — so text never misfires.