From e167b04b8595990649993ce5f0c5de2c9f73af78 Mon Sep 17 00:00:00 2001 From: vlakoff <544424+vlakoff@users.noreply.github.com> Date: Mon, 20 Apr 2026 04:48:32 +0200 Subject: [PATCH] Warn when Zopfli --ziwi exceeds --zi (#812) --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.rs b/src/main.rs index 214a0ae9..63a7bf45 100644 --- a/src/main.rs +++ b/src/main.rs @@ -430,6 +430,16 @@ fn parse_opts_into_struct( let iterations_without_improvement = *matches .get_one::("iterations-without-improvement") .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 { iteration_count, iterations_without_improvement,