Ignore broken tRNS

This commit is contained in:
Kornel 2021-01-15 13:50:45 +00:00 committed by Josh Holmer
parent 53ddd721a7
commit 3163a92594

View file

@ -111,6 +111,7 @@ pub fn reduced_color_to_palette(png: &PngImage) -> Option<PngImage> {
let transparency_pixel = png
.transparency_pixel
.as_ref()
.filter(|t| png.ihdr.color_type == ColorType::RGB && t.len() >= 6)
.map(|t| RGB8::new(t[1], t[3], t[5]));
for line in png.scan_lines() {
raw_data.push(line.filter);