Commit graph

44 commits

Author SHA1 Message Date
Anhil
70f911fa3e
Make libdeflater and zopfli optional (#319)
* Make `libdeflater` and `zopfli` optional
2020-11-01 20:18:15 -05:00
Josh Holmer
fa11401eb1 Version 3.0.0 2020-05-06 10:11:47 -04:00
Ingvar Stepanyan
23ae9c302f
Switch to standard logging library (#218)
This allows to configure or compile away logging in the library from a single place in Rust apps.

For the CLI side, the usage and output remained the same, except it's now colour-coded.

Fixes #217.
2020-04-18 18:33:48 -04:00
Ingvar Stepanyan
a497513d89
Move Zlib-specific options under Zlib compressor (#210)
Make it statically obvious that they're not compatible with other compressors.
2020-04-17 10:05:13 -04:00
Josh Holmer
139b2878d0 Fix benchmark compilation
Closes #197
2020-04-15 13:26:28 -04:00
Josh Holmer
43735086d1 Migrate to Github Actions
Closes #206
2020-04-15 13:26:28 -04:00
Ingvar Stepanyan
f747269151
Respect deadline in miniz (#200) 2020-03-31 23:31:17 -04:00
Ingvar Stepanyan
121558bf5c
Add libdeflater as an option (#203)
libdeflater is a Rust wrapper around
[libdeflate](https://github.com/ebiggers/libdeflate) - an alternative
heavily optimised library for deflate/zlib/gzip compression and
decompression that is intended for situations where upper bounds of the
output are well-known.

In my benchmarks on test files in the repo it has shown to be usually
both slightly faster and providing better compressed output than
cloudflare-zlib, but in some cases showing the opposite, so rather
than swapping defaults, it's currently provided as another option,
similarly to zopfli.

Since it's not strictly better in all cases, I'm not providing median
numbers, but you can check distribution histograms for time and size
differences here (all using `oxipng -o 6 -t 6 -P`):
https://docs.google.com/spreadsheets/d/1WOKgeYZBhLkQvMGAC36snN4azilElzOFhx63RJu0EZY/edit?usp=sharing
2020-03-31 20:24:57 -04:00
Josh Holmer
d86bc80f43 Prepare for next release 2019-02-01 17:27:03 -05:00
Kornel
dad6230cf1 Check timeout more often during compression (#160) 2019-02-01 16:30:47 -05:00
Kornel
9af874d21b Make reductions return a new uncompressed image (#158)
* Fix verbose message

* No cloning when restoring original data

* Make reductions return a new uncompressed image

Partially fixes #145

* Async reduction evaluator

* Assert

* Faster bit depth check

* Also try 4-bit depth for small-depth images

* Skip test when using miniz

* Ensure palette is trimmed after depth reduction

Fixes #159

* Fudge factor for reductions to prefer better reductions even if gzip estimation says otherwise
2019-01-27 03:22:49 -05:00
Joshua Holmer
1305b5cf17 Fix clippy lints and run rustfmt 2018-11-26 13:41:14 -05:00
Kornel
ff7a9547c3 Nicer wrapper for cfzlib (#149) 2018-11-25 03:29:30 -05:00
Kornel
588d5bd52b Tweaks and Microoptimizations (#146)
* Fixed alpha benchmark

* Dedupe function

* Use integer math when rounding

* Fewer temporaries when slicing palette

* Filtering microoptimizations
2018-11-20 08:39:46 -05:00
Josh Holmer
edd4966cea
Fix compilation error on i686 due to cfzlib incompat (#138)
Closes #137
2018-09-16 14:43:08 -04:00
Josh Holmer
3b42f42491 Revert "Revert "Make cfzlib the default on platforms that support it""
This reverts commit ff0e3df948.
2018-08-04 23:08:30 -04:00
Kornel
1322416ba4 Cleanup on error (#132)
Closes #126
2018-08-04 23:02:56 -04:00
Matthias Krüger
947ccaad04 fix more clippy warnings found by "cargo clippy --all-targets --all-features" (#130) 2018-08-02 23:19:42 -04:00
Josh Holmer
f862a0df24 Apply clippy fixes 2018-07-28 16:51:54 -04:00
Josh Holmer
ff0e3df948 Revert "Make cfzlib the default on platforms that support it"
This reverts commit 2702145f3f.

cfzlib seems to have a MASSIVE memory leak in it. Trying to use it
when processing many files at once will cause your system to run out
of memory.

Closes #125
2018-07-21 00:37:57 -04:00
Josh Holmer
d110949d2a Version 2.0.0 2018-07-20 19:19:20 -04:00
Josh Holmer
2702145f3f Make cfzlib the default on platforms that support it
Raises the minimum Rust version to 1.27.0
2018-07-20 19:03:17 -04:00
Kornel
d2b1d56e8b Improved limiting of max gzip size (#116) 2018-07-10 22:36:43 -04:00
Kornel
442eaf766c Bail early (#104) 2018-06-08 00:09:22 -04:00
Kornel
e472c82876 Option to use Cloudflare's zlib for compression (#103)
Behind the nightly feature flag for now--stable ASM is coming in Rust 1.27
2018-06-04 15:39:51 -04:00
Josh Holmer
fe9cd01b82 Replace miniz_sys with miniz_oxide, a Rust implementation of miniz
This also improves decompression performance by 15%, and obsoletes the
`--zm` parameter.

Closes #57
2018-01-30 23:52:37 -05:00
Josh Holmer
88f5bb0931 Hide modules from documentation, and only export structs used in options or return types 2018-01-10 10:37:01 -05:00
Josh Holmer
fe9fd95b21 Update some old documentation 2018-01-10 10:26:12 -05:00
Josh Holmer
0db03c6faf Fix new clippy lints 2017-09-03 23:36:38 -04:00
Josh Holmer
413f1aac7c Automatically change transparent pixels to black 2017-07-24 08:47:27 -04:00
Joshua Holmer
8e02aa8294 Remove zlib dependency, which broke with the new version of zlib 2017-02-21 21:45:53 -05:00
Josh Holmer
7261fa3398 Release 0.13.0 2016-12-12 13:54:18 -05:00
Josh Holmer
6d49d7b8f9 Implement zopfli compression, available as a CLI flag (-Z)
Improves compression by about 10% over DEFLATE, but takes a very long
time at the moment, so it is off by default.
2016-12-01 12:51:30 -05:00
Josh Holmer
d99db3ad23 Convert results to return a PngError
Closes #44
2016-08-16 12:38:09 -04:00
Josh Holmer
58a36902f6 Fix tests 2016-08-03 08:27:45 -04:00
Josh Holmer
37c32b80ef Remove quickcheck, as it breaks tests against 1.6.0 2016-08-03 08:15:01 -04:00
Josh Holmer
64edc9110e Start using quickcheck and add inline hints 2016-07-30 23:14:36 -04:00
Joshua Holmer
f3b8665278 Use miniz for compression strategies 0 and 1
Worst case (RGB/A images) it performs similarly to zlib
Best case (Indexed images) it performs 1-2 orders of magnitude better

Zlib is kept for strategies 2 and 3, where it performs an order of
magnitude better than miniz
2016-04-20 23:14:41 -04:00
Joshua Holmer
2974bbbee3 Fix issue with very small images [ci skip] 2016-04-04 11:06:00 -04:00
Joshua Holmer
eba8062ba5 Add documentation to publicly visible areas of lib
Fixes #17
2016-03-08 11:59:37 -05:00
Joshua Holmer
9fa55ae34a Fix all bit depth and color reduction tests
Closes #8
2016-03-02 12:40:56 -05:00
Joshua Holmer
12b472e572 Rename project 2016-01-11 11:03:52 -05:00
Joshua Holmer
913d9e0c46 Minor typing optimizations 2016-01-08 16:20:04 -05:00
Joshua Holmer
052b047222 Get zlib compression to work 2016-01-01 01:00:57 -05:00