Commit graph

41 commits

Author SHA1 Message Date
Moe
40a88f57f7
initial implementation of timestamp preservation #166 (#360)
Closes #166
2021-07-11 23:34:10 -04:00
Rémi Lauzier
91a18ebe97 Fix some clippy warnings 2021-06-24 15:57:41 -04:00
Kornel
f8bb4fa637 Fix tests without default features 2021-06-16 17:37:33 -04:00
Ingvar Stepanyan
e38c759563
Switch to crossbeam-channel + rayon::spawn (#327)
* Switch to crossbeam-channel + rayon::spawn

* Remove thread_spawn for evaluation altogether

This allows to avoid a deadlock when there is only one Rayon thread, and doesn't sacrifice performance, since the caller of .get_result() had to always block on the iterator to be finished anyway, and all the messages are already sent from separate threads.

* Fix `verbose_mode` test

This one is easier to "fix", since we're in control of the rayon pool - just adding one extra thread to the default number to make sure we always can one root "spawn" call without stealing from the actual pool.
2020-11-11 12:01:13 -05: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
Josh Holmer
43735086d1 Migrate to Github Actions
Closes #206
2020-04-15 13:26:28 -04:00
Ingvar Stepanyan
878bbedb37
Improve performance consistency (#202)
* Improve performance consistency

Switch from HashMap / HashSet to IndexMap / IndexSet for consistent iteration order of various options and, as a result, more predictable performance.
2020-03-31 21:54:05 -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
Felix Hanau
5dcfe44ccd Fix info message and typos (#172) 2019-06-18 13:06:37 -04: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
Kornel
96eda85806 Identify and drop useless sRGB profiles (#143) 2018-11-13 14:37:02 -05:00
Kornel
3c466df80e Chunk name as 4 bytes (#135) 2018-09-16 16:09:55 -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
d110949d2a Version 2.0.0 2018-07-20 19:19:20 -04:00
Kornel
c530bba261 --keep option (#121) 2018-07-17 23:55:21 -04:00
Kornel
c99b3778b2 Expose only one internal module specifically for tests (#123)
Closes #98
2018-07-17 23:38:11 -04:00
Kornel
cb52d8466a Reading from stdin (#118) 2018-07-12 07:54:06 -04:00
Kornel
ebf541219c DRYyer tests (#117) 2018-07-10 22:38:49 -04:00
Kornel
55a095d536 Enum for stdout writing flag (#110) 2018-07-10 18:41:06 -04:00
Kornel
e83762d3b1 Remove deprecated Error::description (#109) 2018-07-06 07:26:49 -04:00
Josh Holmer
e3ba535a79 Add some changes and fixes around how the output file is handled
See changelog for details
2018-01-10 20:54:15 -05:00
Josh Holmer
413f1aac7c Automatically change transparent pixels to black 2017-07-24 08:47:27 -04:00
Josh Holmer
6c8e7d253d Verify images are correct before outputting them, and fix a bug in certain images
Closes #60
2017-03-06 20:16:28 -05:00
Josh Holmer
44818a854b Fix two bugs in reducing palette and release version 0.14.2 2017-02-22 15:45:46 -05:00
Josh Holmer
2810316f4e Reduce certain headers when reducing color type
Fixes #52
2016-12-12 09:57: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
7f9ad263ec Refactor code into modules 2016-07-14 11:10:10 -04:00
Joshua Holmer
2659776bd5 Fix issue for interlacing images smaller than 4px
Fixes #42
2016-05-25 23:10:44 -04:00
Joshua Holmer
3a39b13acf Add option for changing number of threads at runtime
Closes #39
2016-05-04 10:37:45 -04:00
Joshua Holmer
a84611c9ae Replace appropriate uses of assert! with assert_eq! in test suite 2016-05-03 08:03:25 -04:00
Joshua Holmer
a4a5953786 Implement --fix to fix CRC errors in PNG block headers
Closes #5
2016-05-02 09:25:48 -04:00
Joshua Holmer
08eb44ec1a Partially implement --preserve
Needs better implementation once stable Rust improves,
or perhaps see if there's a crate for this

Reference #4 but keep open
2016-04-29 23:37:27 -04:00
Joshua Holmer
c78e3213d6 Update crates and fix interlacing issue 2016-04-08 13:37:00 -04:00
Joshua Holmer
1fc81ef683 Support interlaced files and allow conversion between interlaced and progressive files
Closes #3
2016-04-04 16:07:46 -04:00
Joshua Holmer
5740867be5 Work on implementing interlacing [ci skip] 2016-03-29 22:44:21 -04:00
Joshua Holmer
b889c73a3b Make --strip option more versatile
Closes #22
2016-03-05 22:36:31 -05:00
Joshua Holmer
7d1e3a5bb9 Print console output to stderr instead of stdout
Makes it friendlier with --stdout option
See #20 for discussion
2016-03-04 16:37:40 -05:00
Joshua Holmer
c6452beb12 Select compression and filter modes heuristically for -o1
Closes #21
2016-03-04 15:24:58 -05:00
Joshua Holmer
aa80965196 Ensure each test has its own file
Since we are using real files and not mocks, each tests needs
its own file or else Travis will try to write multiple files
concurrently and fail.
2016-03-03 14:55:37 -05:00
Joshua Holmer
3506d57c7b Move tests into separate modules
More or less fixes #13. We have some repeat util code that I still want to eliminate though.
2016-03-03 12:39:18 -05:00