@@ 40,13 40,13 @@ fn main() {
}
let width = (img.width() as f32 / (img.height() as f32 / height as f32)) as u32;
let path = format!("/tmp/pfp-{width}x{height}.png");
- if !Path::new(&path).exists() {
- if let Err(_) = resize(&img, width, height, image::imageops::FilterType::Nearest)
+ if !Path::new(&path).exists()
+ && resize(&img, width, height, image::imageops::FilterType::Nearest)
.save_with_format(&path, image::ImageFormat::Png)
- {
- eprintln!("Error resizing image");
- exit(1);
- }
+ .is_err()
+ {
+ eprintln!("Error resizing image");
+ exit(1);
}
let b64 = BASE64_STANDARD.encode(&path);
print!("\x1b_Ga=T,q=2,f=100,t=f;{b64}\x1b\\");