jippigy
A multi-threaded image 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.
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
Both Single and Parallel require you to use both of their respective output_dir methods. with_ methods are optional.
Single image compressions with Single
const IMAGE_DIR: &str = "/your/image/dir/";
Multi-threaded bulk compressions with Parallel
In this example, Parallel will attempt to create a separate directory your/image/dir/compressed/ if it doesn't exist and save compressed images here.
const IMAGE_DIR: &str = "/your/image/dir/";