Compare commits

..

View file

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