[Xfce4-commits] [xfce/xfdesktop] 01/01: Rotate images for wallpaper
noreply at xfce.org
noreply at xfce.org
Mon May 25 07:03:04 CEST 2015
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository xfce/xfdesktop.
commit 842971da2ff6f3289dfebb3b4d803397337bed0d
Author: Eric Koegel <eric.koegel at gmail.com>
Date: Mon May 25 07:51:16 2015 +0300
Rotate images for wallpaper
If the image used for the wallpaper contains rotation information
embedded in it, go ahead and rotate the image so it looks better.
---
src/xfce-backdrop.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c
index d45b35b..0344566 100644
--- a/src/xfce-backdrop.c
+++ b/src/xfce-backdrop.c
@@ -1763,6 +1763,11 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
image = gdk_pixbuf_loader_get_pixbuf(loader);
if(image) {
+ /* If the image is supposed to be rotated, do that now */
+ GdkPixbuf *temp = gdk_pixbuf_apply_embedded_orientation (image);
+ /* Do not unref image, gdk_pixbuf_loader_get_pixbuf is transfer none */
+ image = temp;
+
iw = gdk_pixbuf_get_width(image);
ih = gdk_pixbuf_get_height(image);
}
@@ -1905,6 +1910,11 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
g_signal_emit(G_OBJECT(backdrop), backdrop_signals[BACKDROP_READY], 0);
}
+ /* We either created image or took a ref with
+ * gdk_pixbuf_apply_embedded_orientation, free it here
+ */
+ if(image)
+ g_object_unref(image);
backdrop->priv->image_data = NULL;
xfce_backdrop_image_data_release(image_data);
g_free(image_data);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list