From: Dan F. <dfa...@us...> - 2007-11-10 08:02:38
|
Update of /cvsroot/libexif/libexif/libexif/olympus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24805/libexif/olympus Modified Files: exif-mnote-data-olympus.h exif-mnote-data-olympus.c Log Message: Added support for Sanyo makernotes, which are identical to Olympus Index: exif-mnote-data-olympus.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/olympus/exif-mnote-data-olympus.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -p -d -r1.7 -r1.8 --- exif-mnote-data-olympus.h 8 May 2007 09:18:36 -0000 1.7 +++ exif-mnote-data-olympus.h 10 Nov 2007 08:02:33 -0000 1.8 @@ -26,7 +26,7 @@ #include <libexif/exif-byte-order.h> #include <libexif/exif-mem.h> -enum OlympusVersion {nikonV1 = 1, nikonV2 = 2, olympusV1 = 3, olympusV2 = 4 }; +enum OlympusVersion {nikonV1 = 1, nikonV2 = 2, olympusV1 = 3, olympusV2 = 4, sanyoV1 = 5 }; typedef struct _ExifMnoteDataOlympus ExifMnoteDataOlympus; Index: exif-mnote-data-olympus.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/olympus/exif-mnote-data-olympus.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -p -d -r1.31 -r1.32 --- exif-mnote-data-olympus.c 16 Aug 2007 19:49:34 -0000 1.31 +++ exif-mnote-data-olympus.c 10 Nov 2007 08:02:33 -0000 1.32 @@ -97,11 +97,12 @@ exif_mnote_data_olympus_save (ExifMnoteD *buf_size = 6 + 2 + 2 + n->count * 12; switch (n->version) { case olympusV1: + case sanyoV1: *buf = exif_mem_alloc (ne->mem, *buf_size); if (!*buf) return; /* Write the header and the number of entries. */ - strcpy ((char *)*buf, "OLYMP"); + strcpy ((char *)*buf, n->version==sanyoV1?"SANYO":"OLYMP"); exif_set_short (*buf + 6, n->order, (ExifShort) 1); datao = n->offset; break; @@ -208,6 +209,9 @@ exif_mnote_data_olympus_load (ExifMnoteD * a size of 22 bytes (6 for 'OLYMP', 2 other bytes, 2 for the * number of entries, and 12 for one entry. * + * Sanyo format is identical and uses identical tags except that + * header starts with "SANYO". + * * Nikon headers start with "Nikon" (6 bytes including '\0'), * version number (1 or 2). * @@ -219,12 +223,15 @@ exif_mnote_data_olympus_load (ExifMnoteD * lastly 0x2A. */ if (buf_size - n->offset < 22) return; - if (!memcmp (buf + o2, "OLYMP", 6)) { + if (!memcmp (buf + o2, "OLYMP", 6) || !memcmp (buf + o2, "SANYO", 6)) { exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus", - "Parsing Olympus maker note v1..."); + "Parsing Olympus/Sanyo maker note v1..."); /* The number of entries is at position 8. */ - n->version = olympusV1; + if (!memcmp (buf + o2, "SANYO", 6)) + n->version = sanyoV1; + else + n->version = olympusV1; if (buf[o2 + 6] == 1) n->order = EXIF_BYTE_ORDER_INTEL; else if (buf[o2 + 6 + 1] == 1) |