* New translations: nl, se, en_CA
* Bug fixes: #1773810, #1774626
* Enhanced support of Canon makernotes
+ * Added support for Sanyo makernotes
* Added support for the NO_VERBOSE_TAG_STRINGS macro for embedded
applications
if (!e)
return EXIF_DATA_TYPE_MAKER_NOTE_NONE;
- /* Olympus & Nikon */
- if ((e->size >= 8) && (!memcmp (e->data, "OLYMP", 6) ||
- !memcmp (e->data, "OLYMPUS", 8) || !memcmp (e->data, "Nikon", 6)))
+ /* Olympus & Nikon & Sanyo */
+ if ((e->size >= 8) && ( !memcmp (e->data, "OLYMP", 6) ||
+ !memcmp (e->data, "OLYMPUS", 8) ||
+ !memcmp (e->data, "SANYO", 6) ||
+ !memcmp (e->data, "Nikon", 6)))
return EXIF_DATA_TYPE_MAKER_NOTE_OLYMPUS;
em = exif_data_get_entry (d, EXIF_TAG_MAKE);
*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;
* 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).
*
* 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)
#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;