-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
the following image is just a 1x2 image that contains 2 pixels with 2 distinct colors.
loading the image works fine but when I want to access the pixel colors I get panics.
fn main() {
let image = Image::<PalettedRgba>::open("/home/mop/1x2.png").expect("bumms");
println!("{:?}", image.dimensions());
let palette = image.palette();
for color in palette.iter() {
println!("{:?}", color);
}
let mut rows = 0;
for row in image.pixels() {
let mut cols = 0;
for pixel in row {
println!("{:?}", pixel.color());
cols += 1;
}
println!("cols: {}", cols);
rows += 1;
}
println!("counter: {}", rows);
println!("hae {}", image.data.len());
}
Metadata
Metadata
Assignees
Labels
No labels