jippigy
A multi-threaded JPEG compression crate, powered by turbojpeg.
This crate provides methods of compressing JPEG images in a single-threaded or multi-threaded way. Both methods preserves EXIF data of the original JPEG through img_parts crate.
1.0.0 release!
Summary of breaking changes:
- This crate now deals only with your JPEG image bytes. Meaning you have to read your images into a
Vec<u8>orVec<Vec<u8>>where the former is forSingleand the latterParallel. Both outputsVec<u8>image bytes which you can save or do more image processing with. - It doesn't save images or create directories anymore, in fact it doesn't touch your filesystem at all.
- Compressing with
Parallelnow uses an iterator.
See the CHANGELOG.md for more details.
Error building turbojpeg?
The problem is typically related to turbojpeg-sys (see this question and my attempt at setting up CI for this crate).
To successfully build turbojpeg-sys, you need to install cmake, a C compiler (gcc, clang, etc.), and NASM in your system (See: turbojpeg's requirements). For more details, see turbojpeg-sys's Building section.
Examples
with_ methods are optional.
Single image compressions with Single
use Single;
use ;
use Cursor;
Multi-threaded bulk compressions with Parallel
use Parallel;
use ;
use Cursor;