diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2015-05-25 07:51:16 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2015-07-19 16:26:33 +0300 |
commit | 6559503a22d279fb5502f31f9bbb1a1b541bc343 (patch) | |
tree | 1bad3a82f13295328c1d31c8d7a8d86a4e507637 | |
parent | f2647ce4fa523b24b68ce79ed9064db15ddf8832 (diff) | |
download | xfdesktop-6559503a22d279fb5502f31f9bbb1a1b541bc343.tar.gz |
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.
-rw-r--r-- | src/xfce-backdrop.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c index d45b35b6..0344566b 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); |