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.

```rust,ignore use imgparts::jpeg::Jpeg; use imgparts::{ImageEXIF, ImageICC};

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

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

jpeg.seticcprofile(Some(anothericcprofile)); jpeg.setexif(Some(newexifmetadata)); jpeg.writeto(&mut BufWriter::new(output))?; ```

License

Licensed under either of * Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) * MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

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.