pub fn detect_image_format(data: &[u8]) -> ImageFormat
Detect image format from the first bytes of the data.