Always remove iDOT (#741)

Closes #740
This commit is contained in:
andrews05 2025-11-21 08:04:58 +13:00 committed by GitHub
parent 99eccf3f30
commit cb132b1cc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -410,4 +410,16 @@ pub fn postprocess_chunks(aux_chunks: &mut Vec<Chunk>, 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
});
}