This is a reimplementation of the Zopfli compression tool in Rust.
Carol Nichols started the Rust implementation as an experiment in incrementally rewriting a C library in Rust, keeping the project compiling at every step. For more information about that experiment, see the slides for a talk she gave about it and the repo as it was for the experiment.
The minimum supported Rust version (MSRV) for this crate is 1.73. Bumping this version is not considered a breaking change for semantic versioning purposes. We will try to do it only when we estimate that such a bump would not cause widespread inconvenience or breakage.
To build the code, run:
$ cargo build --release
and the executable will be in target/release/zopfli
.
This should work on stable or beta Rust.
There are some unit tests, mostly around the boundary package merge algorithm implementation in katajainen.rs, and a property-based test for compression reversibility. These tests can be run with:
$ cargo test
Golden master tests, to check that compressed files are exactly the same as the C implementation would generate, can be run using:
$ ./test/run.sh