#jpeg #webp #parser #icc #exif

img-parts

Low level crate for reading and writing Jpeg and RIFF image containers

2 releases

✓ Uses Rust 2018 edition

0.1.1 Jun 22, 2020
0.1.0 Apr 1, 2020

#97 in Images

MIT/Apache

40KB
868 lines

img-parts

crates.io Documentation Rustc Version 1.34.2+ CI

The img-parts crate provides a low level api for reading and writing containers from various image formats.

It currently supports Jpeg and RIFF (with some helper functions for WebP).

With it you can read an image, modify its sections and save it back.

use img_parts::jpeg::Jpeg;
use img_parts::{ImageEXIF, ImageICC};

let input = File::open("img.jpg")?;
let output = File::create("out.jpg")?;

let mut jpeg = Jpeg::read(&mut BufReader::new(input))?;
let icc_profile = jpeg.icc_profile();
let exif_metadata = jpeg.exif();

jpeg.set_icc_profile(Some(another_icc_profile));
jpeg.set_exif(Some(new_exif_metadata));
jpeg.write_to(&mut BufWriter::new(output))?;

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~105KB