From cb132b1cc4c219f53c1b345dd755b7bcb95fe91e Mon Sep 17 00:00:00 2001 From: andrews05 Date: Fri, 21 Nov 2025 08:04:58 +1300 Subject: [PATCH] Always remove iDOT (#741) Closes #740 --- src/headers.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/headers.rs b/src/headers.rs index 06e09974..504fc8ff 100644 --- a/src/headers.rs +++ b/src/headers.rs @@ -410,4 +410,16 @@ pub fn postprocess_chunks(aux_chunks: &mut Vec, ihdr: &IhdrData, orig_ihd !invalid }); } + + // Remove iDOT which will necessarily be invalid after successful optimization + aux_chunks.retain(|c| { + let invalid = &c.name == b"iDOT"; + if invalid { + trace!( + "Removing {} chunk as it no longer matches the IDAT", + std::str::from_utf8(&c.name).unwrap() + ); + } + !invalid + }); }