Only change interlacing if we have to

This commit is contained in:
Joshua Holmer 2016-01-15 13:35:41 -05:00
parent c9ea565d1d
commit 0866eb01ea

View file

@ -100,10 +100,12 @@ pub fn optimize(filepath: &Path, opts: &Options) -> Result<(), String> {
}
if let Some(interlacing) = opts.interlace {
if png.change_interlacing(interlacing) {
something_changed = true;
// TODO: Print message to terminal
};
if interlacing != png.ihdr_data.interlaced {
if png.change_interlacing(interlacing) {
something_changed = true;
// TODO: Print message to terminal
}
}
}
if opts.idat_recoding || something_changed {