editing: Fix preroateted images

Editing does not work correctly if PNGs or JPEGs are already rotated via
an Exif orientation entry before editing. This needs the glycin-image-rs
1.2.1 loader to work correctly.

Closes #481
This commit is contained in:
Sophie Herold 2025-03-29 19:41:23 +01:00
parent a49096ffde
commit ef5f94859b
10 changed files with 74 additions and 40 deletions

View file

@ -52,6 +52,7 @@ use adw::prelude::*;
use adw::subclass::prelude::*;
use glib::subclass::Signal;
use glib::{Properties, SignalGroup};
use gufo_common::orientation::Orientation;
use crate::decoder::{self, tiling, Decoder, DecoderUpdate};
use crate::deps::*;
@ -225,6 +226,7 @@ mod imp {
/// Currently EXIF data
pub(super) metadata: RefCell<Metadata>,
pub(super) original_orientation: Cell<Option<Orientation>>,
#[property(get=Self::image_size_available)]
_image_size_available: bool,
@ -393,5 +395,8 @@ impl LpImage {
*imp.file.borrow_mut() = original_imp.file.borrow().clone();
imp.frame_buffer
.swap(Arc::new((*(original_imp.frame_buffer).load_full()).clone()));
imp.original_orientation
.set(Some(original_imp.metadata.borrow().orientation()));
}
}