Always run palette reduction even if there's only one entry

This commit is contained in:
Andrew 2024-03-28 18:21:10 +13:00 committed by andrews05
parent 1ddab42edb
commit fca76a7afb

View file

@ -14,9 +14,8 @@ pub fn reduced_palette(png: &PngImage, optimize_alpha: bool) -> Option<PngImage>
if png.ihdr.bit_depth != BitDepth::Eight {
return None;
}
let palette = match &png.ihdr.color_type {
ColorType::Indexed { palette } if palette.len() > 1 => palette,
_ => return None,
let ColorType::Indexed { palette } = &png.ihdr.color_type else {
return None;
};
let mut used = [false; 256];