jpng

Crates.iojpng
lib.rsjpng
version0.1.0
sourcesrc
created_at2018-07-20 07:01:48.659384
updated_at2018-07-20 07:01:48.659384
descriptionLibrary for handling JPNG images.
homepage
repositoryhttps://github.com/Roughsketch/jpng
max_upload_size
id75176
size9,542
Rust Platform (github:apollographql:rust-platform)

documentation

https://docs.rs/jpng

README

jpng

Library for handling JPNG files.

Currently this crate only supports splitting and saving individual parts of the JPNG.

Usage

To create a JPNG, you pass in a path to the constructor.

let jpng = jpng::Jpng::new("example.jpng")?;

This method will fail if the file can't be found, or if the given file is a malformed JPNG. From there, you can save either the image (JPEG), mask (PNG), or the combined image by using the following:

jpng.save("output"); // Save the combined image as the file "output.png"
jpng.save_image("image"); // Save the image portion of the JPNG as "image.jpg"
jpng.save_mask("mask"); // Save the mask portion of the JPNG as "mask.png"
Commit count: 8

cargo fmt