Revision: 2153
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2153&view=rev
Author:   teuf
Date:     2008-11-17 19:56:43 +0000 (Mon, 17 Nov 2008)

Log Message:
-----------
Attempt at fixing an artwork display bug on the nano4g

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

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2008-11-17 19:56:28 UTC (rev 2152)
+++ libgpod/trunk/ChangeLog     2008-11-17 19:56:43 UTC (rev 2153)
@@ -1,5 +1,12 @@
 2008-11-17  Christophe Fergeau  <[EMAIL PROTECTED]>
 
+       * src/ithumb-writer.c: rework the way we calculate that thumbnails
+       must be resized to when being transferred to the ipod. The old way
+       had rounding errors which led to display bugs on the nano4g (in the
+       album list)
+
+2008-11-17  Christophe Fergeau  <[EMAIL PROTECTED]>
+
        * src/ithumb-writer.c: stricter sanity check 
 
 2008-11-17  Christophe Fergeau  <[EMAIL PROTECTED]>

Modified: libgpod/trunk/src/ithumb-writer.c
===================================================================
--- libgpod/trunk/src/ithumb-writer.c   2008-11-17 19:56:28 UTC (rev 2152)
+++ libgpod/trunk/src/ithumb-writer.c   2008-11-17 19:56:43 UTC (rev 2153)
@@ -791,13 +791,22 @@
 
     if (!crop)
     {
-      /* If we're not cropping, we need to be able to fit both the whole width
-         and whole height, so we use the smaller of the two possible scale
-         factors. */
-      scale = MIN(width_scale, height_scale);
-      offset_x = offset_y = 0;
-      return gdk_pixbuf_scale_simple (input_pixbuf, 
-                                     input_width*scale, input_height*scale,
+      guint scaled_height;
+      guint scaled_width;
+
+      if (width_scale < height_scale) {
+       scaled_width = width;
+       scaled_height = MIN (ceil (input_height*width_scale), height);
+      } else if (width_scale > height_scale) {
+       scaled_width =MIN (ceil (input_width*height), width);
+       scaled_height = height;
+      } else {
+       scaled_width = width;
+       scaled_height = height;
+      }
+       
+      return gdk_pixbuf_scale_simple (input_pixbuf,
+                                     scaled_width, scaled_height,
                                      GDK_INTERP_BILINEAR);
     } else {
       double scaled_width, scaled_height;


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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to