From a06ac66e720acf17512127c4420da0abdcd2c6e0 Mon Sep 17 00:00:00 2001 From: Genny Date: Sun, 18 Sep 2022 14:22:17 -0500 Subject: Deindex images correctly (oops) --- gifed/src/colorimage.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/gifed/src/colorimage.rs b/gifed/src/colorimage.rs index c908081..8b817de 100644 --- a/gifed/src/colorimage.rs +++ b/gifed/src/colorimage.rs @@ -33,17 +33,18 @@ impl RgbaImage { data[image_index * 4 + 1] = 0; data[image_index * 4 + 2] = 0; data[image_index * 4 + 3] = 0; + continue; } - } else { - let color = table - .get(*color_index) - .ok_or(DecodingError::ColorIndexOutOfBounds)?; - - data[image_index * 4] = color.r; - data[image_index * 4 + 1] = color.g; - data[image_index * 4 + 2] = color.b; - data[image_index * 4 + 3] = 255; } + + let color = table + .get(*color_index) + .ok_or(DecodingError::ColorIndexOutOfBounds)?; + + data[image_index * 4] = color.r; + data[image_index * 4 + 1] = color.g; + data[image_index * 4 + 2] = color.b; + data[image_index * 4 + 3] = 255; } Ok(Self { -- cgit 1.4.1-3-g733a5