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

Modified Files:
        itdb.h ithumb-writer.c 
Log Message:
        * src/ithumb-writer.c: removed re-using of thumbnail data in order
          to avoid incompatibility with iTunes (even though our way was
          more efficient...)



Index: itdb.h
===================================================================
RCS file: /cvsroot/gtkpod/libgpod/src/itdb.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- itdb.h      17 Sep 2006 17:14:21 -0000      1.41
+++ itdb.h      21 Sep 2006 15:11:42 -0000      1.42
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-09-18 01:33:30 jcs>
+/* Time-stamp: <2006-09-22 00:04:45 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.

Index: ithumb-writer.c
===================================================================
RCS file: /cvsroot/gtkpod/libgpod/src/ithumb-writer.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- ithumb-writer.c     17 Sep 2006 17:27:21 -0000      1.20
+++ ithumb-writer.c     21 Sep 2006 15:11:42 -0000      1.21
@@ -49,7 +49,6 @@
        Itdb_ArtworkFormat *img_info;
         DbType db_type;
         guint byte_order;
-       GHashTable *cache;
 };
 typedef struct _iThumbWriter iThumbWriter;
 
@@ -197,27 +196,13 @@
 {
     GdkPixbuf *pixbuf = NULL;
     guint16 *pixels;
-    gchar *filename = NULL;
     gint width, height;
 
-    Itdb_Thumb *old_thumb;
-
     g_return_val_if_fail (writer, FALSE);
     g_return_val_if_fail (thumb, FALSE);
 
     if (thumb->filename)
     {   /* read image from filename */
-       /* If the same filename was written before, just use the old
-          thumbnail to save space on the iPod */
-       old_thumb = g_hash_table_lookup (writer->cache, thumb->filename);
-       if (old_thumb != NULL)
-       {
-           g_free (thumb->filename);
-           memcpy (thumb, old_thumb, sizeof (Itdb_Thumb));
-           thumb->filename = g_strdup (old_thumb->filename);
-           return TRUE;
-       }
-
        pixbuf = gdk_pixbuf_new_from_file_at_size (thumb->filename, 
                                                   writer->img_info->width, 
                                                   writer->img_info->height,
@@ -258,7 +243,7 @@
                  "height", &height,
                  NULL);
 
-    filename = thumb->filename;
+    g_free (thumb->filename);
     thumb->filename = NULL;
 
     /* FIXME: under certain conditions (probably related to
@@ -319,14 +304,6 @@
     g_free (pixels);
     writer->cur_offset += thumb->size;
 
-    if (filename)
-    {
-       g_hash_table_insert (writer->cache, filename, thumb);
-
-       /* !! filename is g_free()d when destroying the hash table. Do not
-          do it here */
-    }
-
     return TRUE;
 }
 
@@ -361,9 +338,6 @@
 
        writer->img_info = g_memdup (info, sizeof (Itdb_ArtworkFormat));
 
-       writer->cache = g_hash_table_new_full (g_str_hash, g_str_equal, 
-                                              g_free, NULL);
-
        writer->byte_order = byte_order;
        writer->db_type = db_type;
 
@@ -372,7 +346,6 @@
                                                  1, 
                                                  db_type);
        if (filename == NULL) {
-               g_hash_table_destroy (writer->cache);
                g_free (writer->img_info);
                g_free (writer);
                return NULL;
@@ -381,7 +354,6 @@
        if (writer->f == NULL) {
                g_print ("Error opening %s: %s\n", filename, strerror (errno));
                g_free (filename);
-               g_hash_table_destroy (writer->cache);
                g_free (writer->img_info);
                g_free (writer);
                return NULL;
@@ -401,7 +373,6 @@
        {   /* Remove empty file */
            unlink (writer->filename);
        }
-       g_hash_table_destroy (writer->cache);
        g_free (writer->img_info);
        g_free (writer->filename);
        g_free (writer);


-------------------------------------------------------------------------
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