From 77e981ff6f99ed856056968602145e721ec8e599 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 29 Oct 2022 10:43:52 +1300 Subject: [PATCH] Fix alpha left and right --- src/reduction/alpha.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reduction/alpha.rs b/src/reduction/alpha.rs index fd810400..a02f7be2 100644 --- a/src/reduction/alpha.rs +++ b/src/reduction/alpha.rs @@ -149,8 +149,8 @@ fn reduced_alpha_to_left(png: &PngImage, bpc: usize, bpp: usize) -> Vec { line_bytes.resize(line_bytes.len() + bpc, 0); } else { line_bytes.extend_from_slice(pixel); + last_pixel = pixel.to_owned(); } - last_pixel = pixel.to_owned(); } reduced.push(line.filter); reduced.extend(line_bytes.chunks(bpp).rev().flatten()); @@ -169,8 +169,8 @@ fn reduced_alpha_to_right(png: &PngImage, bpc: usize, bpp: usize) -> Vec { reduced.resize(reduced.len() + bpc, 0); } else { reduced.extend_from_slice(pixel); + last_pixel = pixel.to_owned(); } - last_pixel = pixel.to_owned(); } } reduced