Always run palette reduction even if there's only one entry
This commit is contained in:
parent
1ddab42edb
commit
fca76a7afb
1 changed files with 2 additions and 3 deletions
|
|
@ -14,9 +14,8 @@ pub fn reduced_palette(png: &PngImage, optimize_alpha: bool) -> Option<PngImage>
|
||||||
if png.ihdr.bit_depth != BitDepth::Eight {
|
if png.ihdr.bit_depth != BitDepth::Eight {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let palette = match &png.ihdr.color_type {
|
let ColorType::Indexed { palette } = &png.ihdr.color_type else {
|
||||||
ColorType::Indexed { palette } if palette.len() > 1 => palette,
|
return None;
|
||||||
_ => return None,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut used = [false; 256];
|
let mut used = [false; 256];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue