Commit graph

691 commits

Author SHA1 Message Date
XhmikosR
110eae7c19 Update .editorconfig 2023-04-22 23:37:16 -04:00
Josh Holmer
a234c39e41 Fix new annoyingly pedantic clippy warnings 2023-04-22 22:25:59 -04:00
Alejandro González
0ff1049eb7 Gate dependency on crossbeam-channel behind the parallel feature
`crossbeam-channel` is only used if the `parallel` flag is enabled, so
it can be gated behind that feature flag to potentially reduce the size
of the build dependency tree for dependent projects.

While at it, I've fixed several warnings emmitted in tests/flags.rs.
2023-04-16 20:05:38 -04:00
Alejandro González
f78586ff7b Remove now unused itertools dependency
The `itertools` dependency became unused at a3b104a2ed, so there is no point in declaring it as a dependency any longer.

This was detected with the help of the
[`cargo-udeps`](https://github.com/est31/cargo-udeps) tool. I then
verified that it was not a false positive.
2023-04-16 20:03:32 -04:00
Douman
cc37f645ba
Refactoring to use appropriate log level for debug logs (#489) 2023-04-04 00:48:01 -04:00
Josh Holmer
5341de2163 Fix new clippy lints 2023-04-03 23:50:03 -04:00
David Apirian
fd5027a017 Add docs for usage via trunk.io 2023-03-19 13:52:48 -04:00
Andrew
d43e63f562 Remove test 167 which is no longer relevant 2023-01-06 15:35:05 -05:00
Andrew
a874fe9cb7 Remove incorrect comment 2023-01-06 15:35:05 -05:00
Andrew
87ba51c936 Fix reduction reporting when no reduction occured 2023-01-06 15:35:05 -05:00
Josh Holmer
95d521c81b Version 8.0.0
Some checks failed
deploy / create-windows-binaries (x86_64) (push) Has been cancelled
deploy / create-unix-binaries (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
deploy / create-unix-binaries (ubuntu-latest, x86_64-unknown-linux-musl) (push) Has been cancelled
deploy / deploy (push) Has been cancelled
2022-12-24 09:19:15 -05:00
andrews05
91e29144b0
Change validation to a debug assert (#481) 2022-12-22 17:05:38 -05:00
andrews05
a3b104a2ed
Faster reductions (#479)
* Add grayscale depth tests and benches

* Don't include filter byte in PngImage.data

* Simplify reductions by not using scan lines

* Faster grayscale reduction

* Simplify reduce_color_type

* Faster depth reduction
2022-12-22 16:56:36 -05:00
andrews05
2008d09915
Reduce alpha to tRNS (#477) 2022-12-13 15:18:19 -05:00
andrews05
2599b9fe82
Tweaks to interlacing and format display (#476) 2022-12-12 09:54:35 -05:00
Andrew
815f12df46 Fix fast with zopfli 2022-12-10 21:47:49 -05:00
andrews05
131a3c6af7
🚀 Revamp alpha optimisation (#475) 2022-12-10 21:14:50 -05:00
andrews05
54ee621e41
Fix Grayscale depth reduction with tRNS (#470) 2022-12-08 06:11:26 -05:00
Josh Holmer
19be14021b Version 7.0.0
Some checks failed
deploy / create-windows-binaries (x86_64) (push) Has been cancelled
deploy / create-unix-binaries (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
deploy / create-unix-binaries (ubuntu-latest, x86_64-unknown-linux-musl) (push) Has been cancelled
deploy / deploy (push) Has been cancelled
2022-12-07 14:17:15 -05:00
andrews05
bd5a0b526b
More Reductions (#468)
* Add test for issue 195

* Reduce grayscale alpha to palette

* Black alpha before color type reductions
2022-12-07 13:22:13 -05:00
andrews05
1934587253
Rebalance presets (#467)
* Add --fast option

* Rebalance presets

* Retain filtered idat
2022-12-07 08:09:19 -05:00
andrews05
3365aca12f
Palette reduction fixes (#466)
* Verify bKGD in tests

* Don't truncate bKGD on output

* Make sure correct bKGD is retained

* Update safe chunk list

* Perform strip first

* Check entire palette map
2022-12-07 07:49:52 -05:00
Mihai Galos
bab00cb961
Dockerize Oxipng (#462) 2022-12-02 05:35:14 -05:00
andrews05
6022fc2aa1
Refactor use_heuristics for fast filter evaluation (#463) 2022-12-02 05:34:38 -05:00
Andrew
15a9b4a3e7 Fast deinterlace for 8-bit+ 2022-11-25 04:23:38 -05:00
andrews05
a41d7de348
New filter strategies (#461)
* Refactor filters as enum

* Include filter byte in filter output

* Add entropy filter

* Add bigrams filter

* Add bigram entropy filter

* Add brute filter

* Replace bit-vec

* Add tests and benches

* Show filters in help

* Use FxHasher in color to palette

* Use windows function for minor improvement
2022-11-19 08:49:25 -05:00
andrews05
420d904ba9
Strengthen alpha reductions (#460)
* Improve up and left alpha reductions

* Disable alpha down and right by default

* Improve performance of up
2022-11-01 19:13:24 -04:00
andrews05
446c788eb3
Full switch to Libdeflater (#457)
* Switch main compressor to libdeflate

* Use libdeflater in evaluate

* Use libdeflater to inflate

* Use libdeflater crc

* Tidy up

* Fix benches

* Allow libdeflater/freestanding feature

* Fix building without zopfli
2022-11-01 09:02:08 -04:00
andrews05
f688d20fe6
Allow setting libdeflate compression level (#455)
* Allow --zc with libdeflater

* Update libdeflater

* Allocate sufficient space for libdefate
2022-10-28 21:54:04 -04:00
andrews05
a02d4ff0dd
Fix directional alpha reductions (#458)
* Fix alpha up and down

* Fix alpha left and right
2022-10-28 19:41:44 -04:00
Andrew
8396a262c3 Fix level 0 2022-10-28 15:40:58 -04:00
Tristan
86a72ea127 Avoid printing output bytes on decompress error
Instead, print the number of bytes decompressed so far

Fixes #452
2022-10-07 14:47:34 -04:00
Alejandro González
9479f5f4f5 Version 6.0.1
Some checks failed
deploy / create-windows-binaries (x86_64) (push) Has been cancelled
deploy / create-unix-binaries (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
deploy / create-unix-binaries (ubuntu-latest, x86_64-unknown-linux-musl) (push) Has been cancelled
deploy / deploy (push) Has been cancelled
2022-09-07 11:50:33 -04:00
Alejandro González
9aa27a75bd Bump dependencies. Fix Zopfli mode generating corrupt images sometimes 2022-09-07 11:50:33 -04:00
Josh Holmer
5fe6350c68
Update CHANGELOG.md 2022-09-05 13:07:05 -04:00
Josh Holmer
5810ae4f49
Version 6.0.0 (#448)
Some checks failed
deploy / create-windows-binaries (x86_64) (push) Has been cancelled
deploy / create-unix-binaries (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
deploy / create-unix-binaries (ubuntu-latest, x86_64-unknown-linux-musl) (push) Has been cancelled
deploy / deploy (push) Has been cancelled
2022-09-05 13:05:52 -04:00
Alejandro González
84bbec0666
Add initial support for changing Zopfli iterations (#446)
* Update and optimize dependencies

These changes update the dependencies to their latest versions, fixing
some known issues that prevented doing so in the first place.

In addition, the direct dependency on byteorder was dropped in favor
of stdlib functions that have been stabilized for some time in Rust, and
the transitive dependency on chrono, pulled by stderrlog, was also
dropped, which had been affected by security issues and improperly
maintained in the past:

- https://github.com/cardoe/stderrlog-rs/issues/31
- https://www.reddit.com/r/rust/comments/ts84n4/chrono_or_time_03/

* Run rustfmt

* Bump MSRV to 1.56.1

Updating to this patch version should not be cumbersome for end-users,
and it is required by a transitive dependency.

* Bump MSRV to 1.57.0

os_str_bytes requires it.

* Add initial support for changing Zopfli iterations

PR https://github.com/shssoichiro/oxipng/pull/445 did some dependency
updates, which included using the latest zopfli version. The latest
version of this crate exposes new options in its API that allow users to
choose the desired number of Zopfli compression iterations, which
may greatly affect execution time. In fact, other optimizers such as
zopflipng dynamically select this number depending on the input file
size (see: https://github.com/shssoichiro/oxipng/issues/414).

As a first step towards making OxiPNG deal with Zopfli better, let's add
the necessary options for libraries to be able to choose the number of
iterations. This number is still fixed to 15 as before when using the
CLI.

* Fix Clippy lint

Co-authored-by: Josh Holmer <jholmer.in@gmail.com>
2022-09-05 12:50:13 -04:00
Alejandro González
94ba8b70b3
Update and optimize dependencies (#445)
* Update and optimize dependencies

These changes update the dependencies to their latest versions, fixing
some known issues that prevented doing so in the first place.

In addition, the direct dependency on byteorder was dropped in favor
of stdlib functions that have been stabilized for some time in Rust, and
the transitive dependency on chrono, pulled by stderrlog, was also
dropped, which had been affected by security issues and improperly
maintained in the past:

- https://github.com/cardoe/stderrlog-rs/issues/31
- https://www.reddit.com/r/rust/comments/ts84n4/chrono_or_time_03/

* Run rustfmt

* Bump MSRV to 1.56.1

Updating to this patch version should not be cumbersome for end-users,
and it is required by a transitive dependency.

* Bump MSRV to 1.57.0

os_str_bytes requires it.
2022-09-05 12:37:47 -04:00
dependabot[bot]
e5d1c7dbaa Bump thread_local from 1.0.1 to 1.1.4
Bumps [thread_local](https://github.com/Amanieu/thread_local-rs) from 1.0.1 to 1.1.4.
- [Release notes](https://github.com/Amanieu/thread_local-rs/releases)
- [Commits](https://github.com/Amanieu/thread_local-rs/compare/v1.0.1...1.1.4)

---
updated-dependencies:
- dependency-name: thread_local
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 08:56:21 +00:00
dependabot[bot]
9b14628364 Bump ansi-regex from 6.0.0 to 6.0.1
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v6.0.0...v6.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 08:41:53 +00:00
Matt Riggott
703a25efad Update stderrlog dependency to v0.5.1
Oxipng has an optional dependency on stderrlog, which itself has a
dependency on thread_local. Versions of thread_local < 1.1.4 have a
vulnerability caused by a data race in Iter and IterMut. Updating to
stderrlog v0.5.1 ensures that Oxipng uses a patched version of
thread_local.

https://rustsec.org/advisories/RUSTSEC-2022-0006.html
2022-07-05 10:28:12 -04:00
Josh Holmer
17f5cc36ca Fix clippy lints 2022-07-05 10:05:06 -04:00
carbotaniuman
9054b2d947 Add check option 2022-05-07 23:48:06 -04:00
Rémi Lauzier
7ffbe1fb78 Update dependency and replace deprecated function 2022-03-14 09:21:22 -04:00
Adam Johnson
acdd66b4c5
Add pre-commit hook declaration (#431)
Fixes #429.
2022-01-14 21:55:48 -05:00
Josh Holmer
faf10c64a9 Bump edition to 2021, along with min rust version 2022-01-12 11:50:33 -05:00
Josh Holmer
ece9787822 Bump all dependencies 2022-01-12 02:47:59 -05:00
Josh Holmer
7f6fe08b06 Format cargo.toml using prettier 2022-01-12 02:41:13 -05:00
Josh Holmer
f5053f65bb Add min rust version to Cargo.toml 2022-01-12 02:40:51 -05:00
Josh Holmer
c888142bcb Version 5.0.1
Some checks failed
deploy / create-windows-binaries (x86_64) (push) Has been cancelled
deploy / create-unix-binaries (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
deploy / create-unix-binaries (ubuntu-latest, x86_64-unknown-linux-musl) (push) Has been cancelled
deploy / deploy (push) Has been cancelled
2021-11-15 11:42:06 -05:00