Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zopfli-rs/zopfli
A Rust implementation of the Zopfli compression algorithm.
https://github.com/zopfli-rs/zopfli
hacktoberfest rust zopfli
Last synced: about 1 month ago
JSON representation
A Rust implementation of the Zopfli compression algorithm.
- Host: GitHub
- URL: https://github.com/zopfli-rs/zopfli
- Owner: zopfli-rs
- License: apache-2.0
- Created: 2022-03-05T03:01:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-03T02:56:28.000Z (about 1 month ago)
- Last Synced: 2024-11-03T03:19:32.265Z (about 1 month ago)
- Topics: hacktoberfest, rust, zopfli
- Language: Rust
- Homepage:
- Size: 2.4 MB
- Stars: 36
- Watchers: 3
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
- awesome-rust - zopfli
- awesome-rust-cn - zopfli
- awesome-rust - zopfli - implementation of the Zopfli compression algorithm for higher quality deflate or zlib compression (Libraries / Compression)
- fucking-awesome-rust - zopfli - implementation of the Zopfli compression algorithm for higher quality deflate or zlib compression (Libraries / Compression)
- fucking-awesome-rust - zopfli - implementation of the Zopfli compression algorithm for higher quality deflate or zlib compression (Libraries / Compression)
README
This is a reimplementation of the [Zopfli](https://github.com/google/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](https://github.com/carols10cents/rust-out-your-c-talk) and [the repo as it was for the experiment](https://github.com/carols10cents/zopfli).
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.
## How to build
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.
You can also run `make zopfli`, which will run `cargo build` and then symlink `target/release/zopfli` to just `zopfli` in the project root; this is what the C library does and it was useful for scripting purposes during the rewrite process to keep the command and resulting artifacts the same.
## Running the tests
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
```and then checking that git reports no changes to the files in `test/results`.
Or you can run `make test`, which will run `cargo test` followed by `./test/run.sh`; it will fail if there are any mismatches.