Revision: 2036
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2036&view=rev
Author:   teuf
Date:     2008-07-06 02:42:07 -0700 (Sun, 06 Jul 2008)

Log Message:
-----------
Fix bug in thumbnail resizing when not cropping which caused duplicated lines 
at the bottom of thumbnails

Modified Paths:
--------------
    libgpod/trunk/ChangeLog
    libgpod/trunk/src/ithumb-writer.c

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2008-07-05 16:37:55 UTC (rev 2035)
+++ libgpod/trunk/ChangeLog     2008-07-06 09:42:07 UTC (rev 2036)
@@ -1,3 +1,9 @@
+2008-07-06  Christophe Fergeau <[EMAIL PROTECTED]>
+
+       * src/ithumb-writer.c: fix bug in the function scaling and cropping
+       thumbnails, in the non-cropping case, the returned pixbuf size
+       didn't reflect the size of the scaled pixbuf
+
 2008-07-05  Christophe Fergeau <[EMAIL PROTECTED]>
 
        * src/db-artwork-parser.c: fix small memory leak

Modified: libgpod/trunk/src/ithumb-writer.c
===================================================================
--- libgpod/trunk/src/ithumb-writer.c   2008-07-05 16:37:55 UTC (rev 2035)
+++ libgpod/trunk/src/ithumb-writer.c   2008-07-06 09:42:07 UTC (rev 2036)
@@ -772,9 +772,10 @@
          factors. */
       scale = MIN(width_scale, height_scale);
       offset_x = offset_y = 0;
-    }
-    else 
-    {
+      return gdk_pixbuf_scale_simple (input_pixbuf, 
+                                     input_width*scale, input_height*scale,
+                                     GDK_INTERP_BILINEAR);
+    } else {
       double scaled_width, scaled_height;
       /* If we are cropping, we use the max of the two possible scale factors,
          so that the image is large enough to fill both dimensions. */
@@ -791,24 +792,24 @@
       offset_y = round((height - scaled_height) / 2);
 
       g_assert(round(scaled_width) == width ||
-               round(scaled_height) == height);
-    }
+              round(scaled_height) == height);
 
-    output_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8,
-                                  width + border_width,
-                                   height + border_width);
-    gdk_pixbuf_fill(output_pixbuf, 0xffffffff);
+      output_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8,
+                                    width + border_width,
+                                    height + border_width);
+      gdk_pixbuf_fill(output_pixbuf, 0xffffffff);
 
-    gdk_pixbuf_scale (input_pixbuf,
-                     output_pixbuf,
-                     0, 0,                      /* dest x, dest y */
-                     width,                     /* dest width */
-                     height,                    /* dest height */
-                     offset_x, offset_y,        /* offset x, offset y */
-                     scale, scale,              /* scale x, scale y */
-                     GDK_INTERP_BILINEAR);
+      gdk_pixbuf_scale (input_pixbuf,
+                        output_pixbuf,
+                        0, 0,                   /* dest x, dest y */
+                        width,                     /* dest width */
+                        height,                    /* dest height */
+                        offset_x, offset_y,        /* offset x, offset y */
+                        scale, scale,           /* scale x, scale y */
+                        GDK_INTERP_BILINEAR);
 
-    return output_pixbuf;
+      return output_pixbuf;
+    }
 }
 
 static GdkPixbuf *


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to