diff --git a/news.d/47.rc/fixed-dont-rewrite-image-for-0deg-rotation b/news.d/47.rc/fixed-dont-rewrite-image-for-0deg-rotation new file mode 100644 index 0000000..8e1143d --- /dev/null +++ b/news.d/47.rc/fixed-dont-rewrite-image-for-0deg-rotation @@ -0,0 +1 @@ +Rotating by 0 degrees went through the complete rotation pipeline including a image reload. Now, 0 deg rotations are ignored. diff --git a/src/widgets/image/rotation.rs b/src/widgets/image/rotation.rs index ce4844c..3b2b4a7 100644 --- a/src/widgets/image/rotation.rs +++ b/src/widgets/image/rotation.rs @@ -103,11 +103,13 @@ impl LpImage { } if let Ok(r) = gufo_common::orientation::Rotation::try_from(angle) { - log::debug!("Editing image to rotate by {r:?}"); - let operation = glycin::Operation::Rotate(r); - let editing_queue = &self.imp().editing_queue; - editing_queue.push(operation); - editing_queue.write_to_image(self); + if r != gufo_common::orientation::Rotation::_0 { + log::debug!("Editing image to rotate by {r:?}"); + let operation = glycin::Operation::Rotate(r); + let editing_queue = &self.imp().editing_queue; + editing_queue.push(operation); + editing_queue.write_to_image(self); + } } } }