ultrajpeg 0.5.0-rc8

JPEG encoder/decoder with mozjpeg support and Ultra HDR Image Format v1.1 support.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use ultrajpeg::decode;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let path = std::env::args().nth(1).expect("pass a JPEG path");
    let bytes = std::fs::read(path)?;
    let decoded = decode(&bytes)?;
    println!(
        "{}x{}, gain_map={}",
        decoded.image.width,
        decoded.image.height,
        decoded.gain_map.is_some()
    );
    Ok(())
}