Update of /cvsroot/libexif/libexif/libexif/olympus
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2423
Modified Files:
exif-mnote-data-olympus.c
Log Message:
Nikon v1 makernotes were saved with wrong offsets, Nikon v1 & v2 maker notes
were saved with wrong offset to 2nd IFD (Spotted by Joakim Larsson as patch #1664543)
Index: exif-mnote-data-olympus.c
===================================================================
RCS file: /cvsroot/libexif/libexif/libexif/olympus/exif-mnote-data-olympus.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -d -r1.25 -r1.26
--- exif-mnote-data-olympus.c 5 Jul 2005 08:29:32 -0000 1.25
+++ exif-mnote-data-olympus.c 6 May 2007 17:41:57 -0000 1.26
@@ -108,11 +108,14 @@ exif_mnote_data_olympus_save (ExifMnoteD
case nikonV1:
base = MNOTE_NIKON1_TAG_BASE;
+ /* v1 has offsets based to main IFD, not makernote IFD */
+ datao += n->offset + 10;
/* subtract the size here, so the increment in the next case will not harm us */
- *buf_size -= 8;
+ *buf_size -= 8 + 2;
/* Fall through */
case nikonV2:
- *buf_size += 8;
+ *buf_size += 8 + 2;
+ *buf_size += 4; /* Next IFD pointer */
*buf = exif_mem_alloc (ne->mem, *buf_size);
if (!*buf) return;
@@ -120,7 +123,6 @@ exif_mnote_data_olympus_save (ExifMnoteD
strcpy ((char *)*buf, "Nikon");
(*buf)[6] = n->version;
- *buf_size += 2;
if (n->version == nikonV2) {
exif_set_short (*buf + 10, n->order, (ExifShort) (
(n->order == EXIF_BYTE_ORDER_INTEL) ?
@@ -130,7 +132,9 @@ exif_mnote_data_olympus_save (ExifMnoteD
exif_set_long (*buf + 14, n->order, (ExifShort) 8);
o2 += 2 + 8;
}
- datao = -10;
+ datao -= 10;
+ /* Reset next IFD pointer */
+ exif_set_long (*buf + o2 + 2 + n->count * 12, n->order, 0);
break;
default:
|