2002-07-10 Lutz Müller <lutz@users.sourceforge.net>
authorLutz Mueller <lutz.s.mueller@gmail.com>
Wed, 10 Jul 2002 14:37:05 +0000 (16:37 +0200)
committerLutz Mueller <lutz.s.mueller@gmail.com>
Wed, 10 Jul 2002 14:37:05 +0000 (16:37 +0200)
Bug spotted by Andres <aplaza@smalcamera.com>:

* libexif/exif-data.c: Save the EXIF_TAG_INTEROPERABILITY_IFD_POINTER
  in ifd_exif, not in ifd0.

ChangeLog
libexif/exif-data.c

index 1ca874c..a44b124 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-10  Lutz Müller <lutz@users.sourceforge.net>
+
+       Bug spotted by Andres <aplaza@smalcamera.com>:
+
+       * libexif/exif-data.c: Save the EXIF_TAG_INTEROPERABILITY_IFD_POINTER
+         in ifd_exif, not in ifd0.
+
 2002-06-26  Lutz Müller <lutz@users.sourceforge.net>
 
        Patch by Jos van den Oever <oever@fenk.wau.nl>: Make libexif c++
index f97d1e8..d3bc614 100644 (file)
@@ -263,12 +263,13 @@ exif_data_save_data_content (ExifData *data, ExifContent *ifd,
 {
        unsigned int i, n_ptr = 0, n_thumb = 0;
 
-       /* If we are to save IFD 0, we need some extra entries. */
+       /* If we are to save IFD 0 or 1, we need some extra entries. */
        if (ifd == data->ifd0) {
                if (data->ifd_exif->count)
                        n_ptr++;
                if (data->ifd_gps->count)
                        n_ptr++;
+       } else if (ifd == data->ifd1) {
                if (data->ifd_interoperability->count)
                        n_ptr++;
        }
@@ -332,7 +333,7 @@ exif_data_save_data_content (ExifData *data, ExifContent *ifd,
                offset += 12;
        }
 
-       if (ifd == data->ifd0 && data->ifd_interoperability->count) {
+       if (ifd == data->ifd1 && data->ifd_interoperability->count) {
 
                /* EXIF_TAG_INTEROPERABILITY_IFD_POINTER */
                exif_set_short (*d + 6 + offset + 0, data->priv->order,
@@ -373,7 +374,8 @@ exif_data_save_data_content (ExifData *data, ExifContent *ifd,
                offset += 12;
        }
 
-       if (ifd == data->ifd0 && data->ifd1->count) {
+       if (ifd == data->ifd0 && (data->ifd1->count ||
+                                 data->ifd_interoperability->count)) {
                /*
                 * We are saving IFD 0. Tell where IFD 1 starts and save
                 * IFD 1.