2005-05-01 Lutz Mueller <lutz@users.sourceforge.net>
authorLutz Mueller <lutz.s.mueller@gmail.com>
Sun, 1 May 2005 17:39:25 +0000 (19:39 +0200)
committerLutz Mueller <lutz.s.mueller@gmail.com>
Sun, 1 May 2005 17:39:25 +0000 (19:39 +0200)
* libexif/exif-data.c (exif_data_fix): Don't create EXIF_IFD_1 if no
thumbnail data is available.

ChangeLog
libexif/exif-data.c

index 0ab4a56..fcbcd4d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-05-01  Lutz Mueller <lutz@users.sourceforge.net>
+
+       * libexif/exif-data.c (exif_data_fix): Don't create EXIF_IFD_1 if no 
+       thumbnail data is available.
+
 2005-04-30  Lutz Mueller <lutz@users.sourceforge.net>
 
        * test/test-mem.c: Show how to create EXIF data.
index d22dfd5..07e6293 100644 (file)
@@ -1112,7 +1112,21 @@ exif_data_unset_option (ExifData *d, ExifDataOption o)
 static void
 fix_func (ExifContent *c, void *data)
 {
-       exif_content_fix (c);
+       switch (exif_content_get_ifd (c)) {
+       case EXIF_IFD_1:
+               if (c->parent->data)
+                       exif_content_fix (c);
+               else {
+                       exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
+                                       "No thumbnail but entries on thumbnail. These entries have been "
+                                       "removed.");
+                       while (c->count)
+                               exif_content_remove_entry (c, c->entries[c->count - 1]);
+               }
+               break;
+       default:
+               exif_content_fix (c);
+       }
 }
 
 void