Function turbojpeg::read_header

source ·
pub fn read_header(jpeg_data: &[u8]) -> Result<DecompressHeader>
Expand description

Read the JPEG header without decompressing the image.

§Example

// read JPEG data from file
let jpeg_data = std::fs::read("examples/parrots.jpg")?;

// read the JPEG header
let header = turbojpeg::read_header(&jpeg_data)?;
assert_eq!((header.width, header.height), (384, 256));