Fix alpha left and right

This commit is contained in:
Andrew 2022-10-29 10:43:52 +13:00 committed by Josh Holmer
parent 5429f63227
commit 77e981ff6f

View file

@ -149,8 +149,8 @@ fn reduced_alpha_to_left(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
line_bytes.resize(line_bytes.len() + bpc, 0); line_bytes.resize(line_bytes.len() + bpc, 0);
} else { } else {
line_bytes.extend_from_slice(pixel); line_bytes.extend_from_slice(pixel);
last_pixel = pixel.to_owned();
} }
last_pixel = pixel.to_owned();
} }
reduced.push(line.filter); reduced.push(line.filter);
reduced.extend(line_bytes.chunks(bpp).rev().flatten()); reduced.extend(line_bytes.chunks(bpp).rev().flatten());
@ -169,8 +169,8 @@ fn reduced_alpha_to_right(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
reduced.resize(reduced.len() + bpc, 0); reduced.resize(reduced.len() + bpc, 0);
} else { } else {
reduced.extend_from_slice(pixel); reduced.extend_from_slice(pixel);
last_pixel = pixel.to_owned();
} }
last_pixel = pixel.to_owned();
} }
} }
reduced reduced