Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carols10cents/zopfli
A Rust implementation of the Zopfli compression algorithm.
https://github.com/carols10cents/zopfli
Last synced: about 2 months ago
JSON representation
A Rust implementation of the Zopfli compression algorithm.
- Host: GitHub
- URL: https://github.com/carols10cents/zopfli
- Owner: carols10cents
- License: apache-2.0
- Archived: true
- Fork: true (google/zopfli)
- Created: 2016-04-22T23:01:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-03-05T03:19:48.000Z (almost 3 years ago)
- Last Synced: 2024-08-01T03:28:00.064Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 1.65 MB
- Stars: 77
- Watchers: 9
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: COPYING
Awesome Lists containing this project
- awesome-rust-cn - carols10cents/zopfli
- awesome-rust - carols10cents/zopfli
- awesome-rust-zh - carols10cents/zopfli - 实现[Zopfli](https://github.com/google/zopfli)压缩算法,用于更高质量的 deflate 或 zlib 压缩 (库 / 压缩)
- awesome-rust - carols10cents/zopfli
README
# Zopfli in Rust
This is a reimplementation of the [Zopfli](https://github.com/google/zopfli) compression tool in Rust.
**If you're looking for the maintained repo of the Rust Zopfli implementation, please go to https://github.com/zopfli-rs/zopfli**.
I 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).
**This repo is now archived for historical context for the rewrite experiment and the talk. Please file all issues and pull requests on https://github.com/zopfli-rs/zopfli.**
## 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, that 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`, then `./test/run.sh`, and then will fail if there are any changed files according to git. Note that if you have uncommitted changes and you run this, your changes will cause this command to fail, but the tests actually passed.