A Rust library for decoding JPEGs.
Cargo.toml:
[dependencies]
jpeg-decoder = "0.1"
main.rs:
extern crate jpeg_decoder as jpeg;
use std::fs::File;
use std::io::BufReader;
fn main() {
let file = File::open("hello_world.jpg").expect("failed to open file");
let mut decoder = jpeg::Decoder::new(BufReader::new(file));
let pixels = decoder.decode().expect("failed to decode image");
let metadata = decoder.info().unwrap();
}
This crate compiles only with rust >= 1.34.