Warn when Zopfli --ziwi exceeds --zi (#812)
This commit is contained in:
parent
fbae35922d
commit
e167b04b85
1 changed files with 10 additions and 0 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -430,6 +430,16 @@ fn parse_opts_into_struct(
|
||||||
let iterations_without_improvement = *matches
|
let iterations_without_improvement = *matches
|
||||||
.get_one::<NonZeroU64>("iterations-without-improvement")
|
.get_one::<NonZeroU64>("iterations-without-improvement")
|
||||||
.unwrap_or(&NonZeroU64::MAX);
|
.unwrap_or(&NonZeroU64::MAX);
|
||||||
|
|
||||||
|
if iterations_without_improvement > iteration_count
|
||||||
|
&& iterations_without_improvement != NonZeroU64::MAX
|
||||||
|
{
|
||||||
|
warn!(
|
||||||
|
"--ziwi ({}) is higher than --zi ({}) and will never be reached.",
|
||||||
|
iterations_without_improvement, iteration_count
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
opts.deflater = Deflater::Zopfli(ZopfliOptions {
|
opts.deflater = Deflater::Zopfli(ZopfliOptions {
|
||||||
iteration_count,
|
iteration_count,
|
||||||
iterations_without_improvement,
|
iterations_without_improvement,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue