Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose zc level 0 (uncompressed) 🚀 #641

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MANUAL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Options:
CPU cores.

--zc <level>
Deflate compression level (1-12) for main compression trials. The levels here are defined
Deflate compression level (0-12) for main compression trials. The levels here are defined
by the libdeflate compression library.

The default value depends on the optimization level preset.
Expand Down
6 changes: 3 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,15 @@ CPU cores.")
)
.arg(
Arg::new("compression")
.help("Deflate compression level (1-12)")
.help("Deflate compression level (0-12)")
.long_help("\
Deflate compression level (1-12) for main compression trials. The levels here are defined \
Deflate compression level (0-12) for main compression trials. The levels here are defined \
by the libdeflate compression library.

The default value depends on the optimization level preset.")
.long("zc")
.value_name("level")
.value_parser(1..=12)
.value_parser(0..=12)
.conflicts_with("zopfli"),
)
.arg(
Expand Down
2 changes: 1 addition & 1 deletion src/deflate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub use zopfli_oxipng::deflate as zopfli_deflate;
pub enum Deflaters {
/// Use libdeflater.
Libdeflater {
/// Which compression level to use on the file (1-12)
/// Which compression level to use on the file (0-12)
compression: u8,
},
#[cfg(feature = "zopfli")]
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ fn optimize_raw(
deadline: Arc<Deadline>,
max_size: Option<usize>,
) -> Option<PngData> {
// Libdeflate has four algorithms: 1-4 = 'greedy', 5-7 = 'lazy', 8-9 = 'lazy2', 10-12 = 'near-optimal'
// Libdeflate has four algorithms: 0 = 'uncompressed', 1-4 = 'greedy', 5-7 = 'lazy', 8-9 = 'lazy2', 10-12 = 'near-optimal'
// 5 is the minimumm required for a decent evaluation result
// 7 is not noticeably slower than 5 and improves evaluation of filters in 'fast' mode (o2 and lower)
// 8 is a little slower but not noticeably when used only for reductions (o3 and higher)
Expand Down