From fcf7ed19a45341dfbc6a38921ae930d33ade7638 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Wed, 6 Mar 2013 20:11:21 +0300 Subject: 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 file changed, 5 insertions(+) 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; -- 1.7.10.4