Compare commits

..

View file

@ -81,25 +81,21 @@ impl State {
}
Key::Character("r") => {
match self.image.as_ref() {
None => self.error = Some("no image to rotate".into()),
Some(image) => {
self.error = None;
let Some(image) = self.image.as_ref() else {
eprintln!("no image to rotate");
return Task::none();
};
self.image = Some(imageops::rotate90(image));
return self.allocate_image();
}
};
}
Key::Character("i") => {
match self.image.as_mut() {
None => self.error = Some("no image to invert".into()),
Some(image) => {
self.error = None;
let Some(image) = self.image.as_mut() else {
eprintln!("no image to invert");
return Task::none();
};
imageops::invert(image);
return self.allocate_image();
}
};
}
Key::Character("s") => {
self.error = self.save_image();
@ -145,9 +141,7 @@ impl State {
path.display()
));
}
Err(e) => {
return Some(format!("failed to decode jxl '{}': {e}", path.display()));
}
Err(e) => return Some(format!("faled to decode '{}' {e}", path.display())),
}
}