Fixed error handling

This commit is contained in:
Gregory Ballantine 2024-05-17 13:56:24 -04:00
parent 8ddce80ced
commit d2fb7a6ca4

View File

@ -2,7 +2,8 @@ use image::io::Reader as ImageReader;
fn main() { fn main() {
println!("Converting test.webp to test.png."); println!("Converting test.webp to test.png.");
let img = ImageReader::open("test.webp")?.decode()?; let img_raw = ImageReader::open("test.webp").expect("Failed to load test.webp.")
img.save("test.png")?; let img = img_raw.decode().expect("Failed to decode the image.");
img.save("test.png").("Failed to save test.png.");
println!("Done."); println!("Done.");
} }