We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b632407 commit 31c6efeCopy full SHA for 31c6efe
src/images.rs
@@ -99,13 +99,13 @@ fn write_image<const BPP: u8, const PPB: usize>(
99
/// Detect all colors used in the image
100
fn make_palette(img: &RgbaImage) -> Result<Vec<Color>> {
101
let mut palette = Vec::new();
102
- for pixel in img.pixels() {
+ for (x, y, pixel) in img.enumerate_pixels() {
103
let color = convert_color(*pixel);
104
if !palette.contains(&color) {
105
if color.is_some() && !DEFAULT_PALETTE.contains(&color) {
106
bail!(
107
- "found a color not present in the default color palette: {}",
108
- format_color(color)
+ "found a color not present in the default color palette: {} (at x={x}, y={y})",
+ format_color(color),
109
);
110
}
111
palette.push(color);
0 commit comments