diff options
author | Genny <gen@nyble.dev> | 2022-09-18 14:22:17 -0500 |
---|---|---|
committer | Genny <gen@nyble.dev> | 2022-09-18 14:22:17 -0500 |
commit | a06ac66e720acf17512127c4420da0abdcd2c6e0 (patch) | |
tree | 9e1f00d5c00718741dcf7f3df46313986d137848 | |
parent | 95243f5aef27de2a9c1731f8fdd16d2bf7b00e24 (diff) | |
download | gifed-a06ac66e720acf17512127c4420da0abdcd2c6e0.tar.gz gifed-a06ac66e720acf17512127c4420da0abdcd2c6e0.zip |
Deindex images correctly (oops)
-rw-r--r-- | gifed/src/colorimage.rs | 19 |
1 files 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 { |