[mutter] compositor: Handle EXIF orientation for backgrounds



commit 8153c5b544ec61ba52b00a97010319d19d9564c5
Author: Silvère Latchurié <slatchurie gmail com>
Date:   Fri May 26 13:24:36 2017 +0200

    compositor: Handle EXIF orientation for backgrounds
    
    Apply the embedded EXIF orientation when the background is loaded.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783125

 src/compositor/meta-background-image.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/compositor/meta-background-image.c b/src/compositor/meta-background-image.c
index 8ea6426..b060664 100644
--- a/src/compositor/meta-background-image.c
+++ b/src/compositor/meta-background-image.c
@@ -155,7 +155,7 @@ file_loaded (GObject      *source_object,
   CoglError *catch_error = NULL;
   GTask *task;
   CoglTexture *texture;
-  GdkPixbuf *pixbuf;
+  GdkPixbuf *pixbuf, *rotated;
   int width, height, row_stride;
   guchar *pixels;
   gboolean has_alpha;
@@ -173,6 +173,13 @@ file_loaded (GObject      *source_object,
       goto out;
     }
 
+  rotated = gdk_pixbuf_apply_embedded_orientation (pixbuf);
+  if (rotated != NULL)
+    {
+      g_object_unref (pixbuf);
+      pixbuf = rotated;
+    }
+
   width = gdk_pixbuf_get_width (pixbuf);
   height = gdk_pixbuf_get_height (pixbuf);
   row_stride = gdk_pixbuf_get_rowstride (pixbuf);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]