[Xfce4-commits] <xfdesktop:xfce-4.10> Fix tiling for some images

Jérôme Guelfucci noreply at xfce.org
Sat Mar 9 11:44:02 CET 2013


Updating branch refs/heads/xfce-4.10
         to 7b2eda13185b9e48d7f2a45f9b327f8d36a4637c (commit)
       from a22643103bf113f58fb31c90c5a8963457d0783c (commit)

commit 7b2eda13185b9e48d7f2a45f9b327f8d36a4637c
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Wed Mar 6 20:11:21 2013 +0300

    Fix tiling for some images
    
    gdk_pixbuf_get_file_info will return the width and height of the
    bounding box in animation files which will cause the tiling
    function to fail. This adds a check to get the actual width and
    height of the image before tiling it.

 src/xfce-backdrop.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c
index f4c2221..dcf5299 100644
--- a/src/xfce-backdrop.c
+++ b/src/xfce-backdrop.c
@@ -1013,6 +1013,11 @@ xfce_backdrop_get_pixbuf(XfceBackdrop *backdrop)
         case XFCE_BACKDROP_IMAGE_TILED:
             image = gdk_pixbuf_new_from_file(backdrop->priv->image_path, NULL);
             tmp = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, w, h);
+            /* Now that the image has been loaded, recalculate the image
+             * size because gdk_pixbuf_get_file_info doesn't always return
+             * the correct size */
+            iw = gdk_pixbuf_get_width(image);
+            ih = gdk_pixbuf_get_height(image);
             for(i = 0; (i * iw) < w; i++) {
                 for(j = 0; (j * ih) < h; j++) {
                     gint newx = iw * i, newy = ih * j;


More information about the Xfce4-commits mailing list