aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerdinand Stehle <development@kondorgulasch.de>2025-02-22 16:32:33 +0100
committerGitHub <noreply@github.com>2025-02-22 09:32:33 -0600
commitf796286650e4ad862b147e484d528ca56cf5e0e6 (patch)
treedbfdd6417cdacc6f410e56e937478d82fc2cf571
parentfc42c657eef9b6760c3296719b6fcc52852374ab (diff)
downloaddino-f796286650e4ad862b147e484d528ca56cf5e0e6.tar.gz
dino-f796286650e4ad862b147e484d528ca56cf5e0e6.zip
Apply image orientation in conversation view (#1672)
* Apply image orientation in conversation * Load the full image into pixbuf --------- Co-authored-by: fiaxh <git@lightrise.org>
-rw-r--r--main/src/ui/conversation_content_view/file_image_widget.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/src/ui/conversation_content_view/file_image_widget.vala b/main/src/ui/conversation_content_view/file_image_widget.vala
index a7a7bcc0..2b4d1765 100644
--- a/main/src/ui/conversation_content_view/file_image_widget.vala
+++ b/main/src/ui/conversation_content_view/file_image_widget.vala
@@ -157,7 +157,12 @@ public class FileImageWidget : Widget {
public async void load_from_file(File file, string file_name) throws GLib.Error {
FixedRatioPicture image = new FixedRatioPicture() { min_width=100, min_height=100, max_width=600, max_height=300 };
- image.file = file;
+
+ // Work-around because Gtk.Picture does not apply the orientation itself
+ Gdk.Pixbuf? pixbuf = new Pixbuf.from_file(file.get_path());
+ pixbuf = pixbuf.apply_embedded_orientation();
+ image.paintable = Texture.for_pixbuf(pixbuf);
+
stack.add_child(image);
stack.set_visible_child(image);
}