[gdk-pixbuf] Make scaling of xpms work again



commit 653be4169d8da106fc86b1a86a1259a553f6377a
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Dec 18 22:15:29 2013 -0500

    Make scaling of xpms work again
    
    Commit c62676a284 had an unintended side-effect for loaders
    which omit to call size_func, the new size set by
    gdk_pixbuf_loader_set_size would overwrite the original
    pixbuf size, and in effect force a scale factor of 1.0.
    The xpm loader is one of the few which omit the size_func
    call, thus the regression that calling
    gdk_pixbuf_new_from_file_at_scale does not scale xpms anymore.
    The fix is to use separate variables to pass the dimensions
    when calling the size_func on behalf of the loader.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686514

 gdk-pixbuf/gdk-pixbuf-loader.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c
index 96920e0..5cf3f74 100644
--- a/gdk-pixbuf/gdk-pixbuf-loader.c
+++ b/gdk-pixbuf/gdk-pixbuf-loader.c
@@ -325,8 +325,10 @@ gdk_pixbuf_loader_prepare (GdkPixbuf          *pixbuf,
 
         if (!priv->size_fixed) 
                 {
+                       gint w = width;
+                       gint h = height;
                         /* Defend against lazy loaders which don't call size_func */
-                        gdk_pixbuf_loader_size_func (&width, &height, loader);
+                        gdk_pixbuf_loader_size_func (&w, &h, loader);
                 }
 
         priv->needs_scale = FALSE;


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