Crate jfifdump

source ·
Expand description

§JFIF Dump

A crate for reading the content of a JFIF file without decoding JPEG image data.

§Example: Print image dimensions


use jfifdump::{Reader, SegmentKind};
use std::fs::File;
use std::io::BufReader;

let file = File::open("some.jpeg")?;

let mut reader = Reader::new(BufReader::new(file))?;

loop {
    match reader.next_segment()?.kind {
        SegmentKind::Eoi => break,
        SegmentKind::Frame(frame) => {
            println!("{}x{}", frame.dimension_x, frame.dimension_y);
            break;
        }
        _ => {
            // Ignore other segments
        }
    }
}

}

Structs§

Enums§

Traits§

Functions§

  • Read JFIF input and call handler for all segments