Clean up code
This commit is contained in:
parent
f5fa17059e
commit
80b03efbf5
17
src/main.rs
17
src/main.rs
|
@ -37,23 +37,12 @@ fn save(
|
|||
|
||||
println!("Created image");
|
||||
|
||||
//for x in 0..width {
|
||||
// for y in 0..height {
|
||||
// let foo = image::Rgb([255, 255, 255]);
|
||||
// out.put_pixel(x, y, foo);
|
||||
// }
|
||||
//}
|
||||
|
||||
for (x, y, px) in chunk {
|
||||
out.put_pixel(*x, *y, **px);
|
||||
}
|
||||
|
||||
println!("Applied pixels to new image");
|
||||
|
||||
// out.save(format!("output/{}.jpg", iter))?;
|
||||
|
||||
// let mut bytes: Vec<u8> = Vec::new();
|
||||
// out.write_to(&mut bytes, image::ImageOutputFormat::Jpeg);
|
||||
let bytes: Vec<u8> = out.into_raw();
|
||||
|
||||
if let Err(e) = std::panic::catch_unwind(|| {
|
||||
|
@ -74,15 +63,9 @@ fn save(
|
|||
panic!("Error: could not save the file to disk.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}) {
|
||||
panic!("Error: {:?}", e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue