tag format and namespace of the Olympus ones.
+2009-01-12 Dan Fandrich <dan@coneharvesters.com>
+
+ * Added support for Epson MakerNotes, which have the identical
+ tag format and namespace of the Olympus ones.
+
2009-01-06 Dan Fandrich <dan@coneharvesters.com>
* libexif/exif-tags.c: Added remaining GPS tags from the EXIF 2.2
* Access to the raw EXIF data through the ExifEntry structure members is
now officially documented
* Fixed some Olympus/Sanyo MakerNote interpretations
+ * Added support for Epson MakerNotes
* Fixed bug #1946138 to stop ignoring CFLAGS in the sqrt configure test
* Added remaining GPS tags from the EXIF 2.2 spec to the tag table
* Fixed the interpretation of some tags as being optional in IFD 1
--------
libexif supports parsing, editing and saving of EXIF data. In addition, it
-has gettext support. All EXIF tags described in EXIF standard 2.1
-are supported. Many maker notes from Canon, Casio, Fuji, Nikon, Olympus,
-Pentax and Sanyo cameras are also supported.
+has gettext support. All EXIF tags described in EXIF standard 2.1 (and most
+from 2.2) are supported. Many maker notes from Canon, Casio, Epson,
+Fuji, Nikon, Olympus, Pentax and Sanyo cameras are also supported.
REQUIREMENTS
if ((e->size >= 8) && ( !memcmp (e->data, "OLYMP", 6) ||
!memcmp (e->data, "OLYMPUS", 8) ||
!memcmp (e->data, "SANYO", 6) ||
+ !memcmp (e->data, "EPSON", 6) ||
!memcmp (e->data, "Nikon", 6)))
return EXIF_DATA_TYPE_MAKER_NOTE_OLYMPUS;
switch (n->version) {
case olympusV1:
case sanyoV1:
+ case epsonV1:
*buf = exif_mem_alloc (ne->mem, *buf_size);
if (!*buf) return;
/* Write the header and the number of entries. */
- strcpy ((char *)*buf, n->version==sanyoV1?"SANYO":"OLYMP");
+ strcpy ((char *)*buf, n->version==sanyoV1?"SANYO":
+ (n->version==epsonV1?"EPSON":"OLYMP"));
exif_set_short (*buf + 6, n->order, (ExifShort) 1);
datao = n->offset;
break;
* Sanyo format is identical and uses identical tags except that
* header starts with "SANYO".
*
+ * Epson format is identical and uses identical tags except that
+ * header starts with "EPSON".
+ *
* 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) || !memcmp (buf + o2, "SANYO", 6)) {
+ if (!memcmp (buf + o2, "OLYMP", 6) || !memcmp (buf + o2, "SANYO", 6) ||
+ !memcmp (buf + o2, "EPSON", 6)) {
exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
- "Parsing Olympus/Sanyo maker note v1...");
+ "Parsing Olympus/Sanyo/Epson maker note v1...");
/* The number of entries is at position 8. */
if (!memcmp (buf + o2, "SANYO", 6))
n->version = sanyoV1;
+ else if (!memcmp (buf + o2, "EPSON", 6))
+ n->version = epsonV1;
else
n->version = olympusV1;
if (buf[o2 + 6] == 1)
#include <libexif/exif-byte-order.h>
#include <libexif/exif-mem.h>
-enum OlympusVersion {nikonV1 = 1, nikonV2 = 2, olympusV1 = 3, olympusV2 = 4, sanyoV1 = 5 };
+enum OlympusVersion {
+ nikonV1 = 1,
+ nikonV2 = 2,
+ olympusV1 = 3,
+ olympusV2 = 4,
+ sanyoV1 = 5,
+ epsonV1 = 6
+};
typedef struct _ExifMnoteDataOlympus ExifMnoteDataOlympus;
char buf[30];
ExifLong vl;
ExifShort vs = 0;
+ ExifSShort vss = 0;
ExifRational vr, vr2;
ExifSRational vsr;
int i, j;
case MNOTE_NIKON_TAG_IMAGEADJUSTMENT:
case MNOTE_NIKON_TAG_ADAPTER:
case MNOTE_NIKON_TAG_SATURATION2:
+ case MNOTE_EPSON_TAG_OEM_MODEL:
CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen);
memcpy(v, entry->data, MIN (maxlen, entry->size));
break;
case MNOTE_NIKON_TAG_TOTALPICTURES:
+ case MNOTE_EPSON_TAG_IMAGE_WIDTH:
+ case MNOTE_EPSON_TAG_IMAGE_HEIGHT:
CF (entry->format, EXIF_FORMAT_LONG, v, maxlen);
CC (entry->components, 1, v, maxlen);
vl = exif_get_long (entry->data, entry->order);
}
break;
case MNOTE_OLYMPUS_TAG_LENSDISTORTION:
- CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen);
- CC (entry->components, 6, v, maxlen);
- for (i=0; i < (int)entry->components; ++i) {
- vs = exif_get_sshort (entry->data+2*i, entry->order);
- sprintf (buf, "%hd ", vs);
+ if (entry->format == EXIF_FORMAT_SHORT) {
+ /* Epson uses a single SHORT here */
+ CC (entry->components, 1, v, maxlen);
+ vs = exif_get_short (entry->data, entry->order);
+ sprintf (buf, "%hu", vs);
strncat (v, buf, maxlen - strlen (v));
+ } else {
+ /* Others use an array of SSHORT here */
+ CC (entry->components, 6, v, maxlen);
+ CF (entry->format, EXIF_FORMAT_SSHORT, v, maxlen);
+ for (i=0; i < (int)entry->components; ++i) {
+ vss = exif_get_sshort (entry->data+2*i, entry->order);
+ sprintf (buf, "%hd ", vss);
+ strncat (v, buf, maxlen - strlen (v));
+ }
}
break;
case MNOTE_OLYMPUS_TAG_COLORCONTROL:
{MNOTE_SANYO_TAG_SCENESELECT, "SceneSelect", N_("Scene Select"), ""},
{MNOTE_SANYO_TAG_MANUALFOCUSDISTANCE, "ManualFocusDistance", N_("Manual Focus Distance"), ""},
{MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL, "SequenceShotInterval", N_("Sequence Shot Interval"), ""},
+
+ /* Epson */
+ {MNOTE_EPSON_TAG_IMAGE_WIDTH, "EpsonImageWidth", N_("Epson Image Width"), ""},
+ {MNOTE_EPSON_TAG_IMAGE_HEIGHT, "EpsonImageHeight", N_("Epson Image Height"), ""},
+ {MNOTE_EPSON_TAG_OEM_MODEL, "EpsonOEMModel", N_("OEM Model Name"), ""},
#endif
{0, NULL, NULL, NULL}
};
MNOTE_SANYO_TAG_SCENESELECT = 0x021f,
MNOTE_SANYO_TAG_MANUALFOCUSDISTANCE = 0x0223,
MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL = 0x0224,
+
+ /* Epson */
+ MNOTE_EPSON_TAG_IMAGE_WIDTH = 0x020b,
+ MNOTE_EPSON_TAG_IMAGE_HEIGHT = 0x020c,
+ MNOTE_EPSON_TAG_OEM_MODEL = 0x020d,
};
typedef enum _MnoteOlympusTag MnoteOlympusTag;