Clean up code

This commit is contained in:
Yash Karandikar 2021-09-11 16:36:21 -05:00
parent f5fa17059e
commit 80b03efbf5
Signed by: karx
GPG key ID: A794DA2529474BA5

View file

@ -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(())
}