[Xfce4-commits] [xfce/xfdesktop] 01/01: Fix scaling of images with orientation metadata (Bug #14644)

noreply at xfce.org noreply at xfce.org
Tue Apr 16 03:37:19 CEST 2019


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfdesktop.

commit 723feab8cd11285410c2a10afa328d6d7611e052
Author: Andre Miranda <andreldm at xfce.org>
Date:   Mon Apr 15 22:35:51 2019 -0300

    Fix scaling of images with orientation metadata (Bug #14644)
---
 src/xfce-backdrop.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c
index 503ba43..4bc9ab8 100644
--- a/src/xfce-backdrop.c
+++ b/src/xfce-backdrop.c
@@ -1780,6 +1780,7 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
     gint dx, dy, xo, yo;
     gdouble xscale, yscale;
     GdkInterpType interp;
+    gboolean rotated = FALSE;
 
     TRACE("entering");
 
@@ -1796,6 +1797,8 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
 
     image = gdk_pixbuf_loader_get_pixbuf(loader);
     if(image) {
+        gint iw_orig = gdk_pixbuf_get_width(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 */
@@ -1803,6 +1806,8 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
 
         iw = gdk_pixbuf_get_width(image);
         ih = gdk_pixbuf_get_height(image);
+
+        rotated = (iw_orig != iw);
     }
 
     if(backdrop->priv->width == 0 || backdrop->priv->height == 0) {
@@ -1917,7 +1922,9 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
             dy = yo;
 
             gdk_pixbuf_composite(image, final_image, dx, dy,
-                    iw * xscale, ih * yscale, xo, yo, 1, 1,
+                    iw * xscale, ih * yscale, xo, yo,
+                    rotated ? xscale : 1,
+                    rotated ? yscale : 1,
                     interp, 255);
             break;
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list