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§

App0Jfif
Dac
Dht
Dqt
Frame
FrameComponent
Reader
A reader for JFIF files
Rst
Scan
ScanComponent
Segment
TextFormat

Enums§

JfifError
SegmentKind

Traits§

Handler

Functions§

read
Read JFIF input and call handler for all segments