Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29097/src

Modified Files:
      Tag: fetchcover_development_branch
        display_coverart.c 
Log Message:
display_coverart.c:
        * Cater for fact that selected playlist might be on the ipod and 
itdb_thumb_get_filename returns the filename of the artwork database. In which 
case display the image stored on the ipod as is (rather annoyingly small)

Index: display_coverart.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_coverart.c,v
retrieving revision 1.7.2.3
retrieving revision 1.7.2.4
diff -u -d -r1.7.2.3 -r1.7.2.4
--- display_coverart.c  1 Apr 2007 19:47:10 -0000       1.7.2.3
+++ display_coverart.c  1 Apr 2007 21:06:59 -0000       1.7.2.4
@@ -529,6 +529,11 @@
        return matches;
 }
 
+/**
+ * 
+ * Display a big version of the artwork in a dialog
+ * 
+ */
 void coverart_display_big_artwork (GList *tracks)
 {
        GtkWidget *dialog;
@@ -555,13 +560,22 @@
        if (thumb)
        {
                gchar *artpath = itdb_thumb_get_filename 
(cover->track->itdb->device, thumb);
-               imgbuf = gdk_pixbuf_new_from_file(artpath, &error);
-               if (error != NULL)
+               if (g_str_has_suffix (artpath, ".ithmb"))
                {
-                       printf("Error occurred loading the default file - 
\nCode: %d\nMessage: %s\n", error->code, error->message);
-                       /* Artwork failed to load from file so try loading 
default */
-                       imgbuf = coverart_get_default_track_thumb ();
-                       g_error_free (error);
+                       /* playlist is on the ipod so display the file as 
appears on ipod */
+                       imgbuf = coverart_get_track_thumb (cover->track);
+               }
+               else
+               {
+                       /* image is maybe in local playlist so should be normal 
file */
+                       imgbuf = gdk_pixbuf_new_from_file(artpath, &error);
+                       if (error != NULL)
+                       {
+                               printf("Error occurred loading the image file - 
\nCode: %d\nMessage: %s\n", error->code, error->message);
+                               /* Artwork failed to load from file so try 
loading default */
+                               imgbuf = coverart_get_default_track_thumb ();
+                               g_error_free (error);
+                       }
                }
                g_free(artpath);
        }


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to