diff options
author | scuri <scuri> | 2009-08-20 12:13:11 +0000 |
---|---|---|
committer | scuri <scuri> | 2009-08-20 12:13:11 +0000 |
commit | 35733b87eed86e5228f12fa10c98a3d9d22a6073 (patch) | |
tree | aa7e3c89788c15b925eecdbdf7e9d98291b4f469 /src/libexif/pentax | |
parent | 83b3c8b629d96f5fdf754d35d5f4f5369dbfef1d (diff) |
*** empty log message ***
Diffstat (limited to 'src/libexif/pentax')
-rw-r--r-- | src/libexif/pentax/exif-mnote-data-pentax.c | 80 | ||||
-rw-r--r-- | src/libexif/pentax/exif-mnote-data-pentax.h | 6 | ||||
-rw-r--r-- | src/libexif/pentax/mnote-pentax-entry.c | 305 | ||||
-rw-r--r-- | src/libexif/pentax/mnote-pentax-entry.h | 2 | ||||
-rw-r--r-- | src/libexif/pentax/mnote-pentax-tag.c | 50 | ||||
-rw-r--r-- | src/libexif/pentax/mnote-pentax-tag.h | 83 |
6 files changed, 439 insertions, 87 deletions
diff --git a/src/libexif/pentax/exif-mnote-data-pentax.c b/src/libexif/pentax/exif-mnote-data-pentax.c index cc2cc12..0d17d62 100644 --- a/src/libexif/pentax/exif-mnote-data-pentax.c +++ b/src/libexif/pentax/exif-mnote-data-pentax.c @@ -1,6 +1,6 @@ /* exif-mnote-data-pentax.c * - * Copyright © 2002, 2003 Lutz Mueller <lutz@users.sourceforge.net> + * Copyright (c) 2002, 2003 Lutz Mueller <lutz@users.sourceforge.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -73,41 +73,67 @@ exif_mnote_data_pentax_load (ExifMnoteData *en, const unsigned char *buf, unsigned int buf_size) { ExifMnoteDataPentax *n = (ExifMnoteDataPentax *) en; - unsigned int i, o, s; + size_t i, o, s, datao = 6 + n->offset, base = 0; ExifShort c; /* Number of entries */ - if (buf_size < 2) return; - c = exif_get_short (buf + 6 + n->offset, n->order); + if (buf_size < datao + (4 + 2) + 2) return; + if (!memcmp(buf + datao, "AOC", 4)) { + if ((buf[datao + 4] == 'I') && (buf[datao + 5] == 'I')) { + n->version = pentaxV3; + n->order = EXIF_BYTE_ORDER_INTEL; + } else if ((buf[datao + 4] == 'M') && (buf[datao + 5] == 'M')) { + n->version = pentaxV3; + n->order = EXIF_BYTE_ORDER_MOTOROLA; + } else { + /* Uses Casio v2 tags */ + n->version = pentaxV2; + } + datao += 4 + 2; + base = MNOTE_PENTAX2_TAG_BASE; + } if (!memcmp(buf + datao, "QVC", 4)) { + n->version = casioV2; + base = MNOTE_CASIO2_TAG_BASE; + datao += 4 + 2; + } else { + n->version = pentaxV1; + } + c = exif_get_short (buf + datao, n->order); n->entries = exif_mem_alloc (en->mem, sizeof (MnotePentaxEntry) * c); if (!n->entries) return; for (i = 0; i < c; i++) { - o = 6 + 2 + n->offset + 12 * i; - if (o + 8 > buf_size) return; - - n->count = i + 1; - n->entries[i].tag = exif_get_short (buf + o + 0, n->order); - n->entries[i].format = exif_get_short (buf + o + 2, n->order); - n->entries[i].components = exif_get_long (buf + o + 4, n->order); - n->entries[i].order = n->order; - - /* - * Size? If bigger than 4 bytes, the actual data is not - * in the entry but somewhere else (offset). - */ - s = exif_format_get_size (n->entries[i].format) * + o = datao + 2 + 12 * i; + if (o + 8 > buf_size) return; + + n->count = i + 1; + n->entries[i].tag = exif_get_short (buf + o + 0, n->order) + base; + n->entries[i].format = exif_get_short (buf + o + 2, n->order); + n->entries[i].components = exif_get_long (buf + o + 4, n->order); + n->entries[i].order = n->order; + + /* + * Size? If bigger than 4 bytes, the actual data is not + * in the entry but somewhere else (offset). + */ + s = exif_format_get_size (n->entries[i].format) * n->entries[i].components; - if (!s) return; - o += 8; - if (s > 4) o = exif_get_long (buf + o, n->order) + 6; - if (o + s > buf_size) return; + if (s > 65536) { + /* Corrupt data: EXIF data size is limited to the + * maximum size of a JPEG segment (64 kb). + */ + continue; + } + if (!s) return; + o += 8; + if (s > 4) o = exif_get_long (buf + o, n->order) + 6; + if (o + s > buf_size) return; - /* Sanity check */ - n->entries[i].data = exif_mem_alloc (en->mem, sizeof (char) * s); - if (!n->entries[i].data) return; - n->entries[i].size = s; - memcpy (n->entries[i].data, buf + o, s); + /* Sanity check */ + n->entries[i].data = exif_mem_alloc (en->mem, s); + if (!n->entries[i].data) return; + n->entries[i].size = s; + memcpy (n->entries[i].data, buf + o, s); } } diff --git a/src/libexif/pentax/exif-mnote-data-pentax.h b/src/libexif/pentax/exif-mnote-data-pentax.h index c04bc41..62f9739 100644 --- a/src/libexif/pentax/exif-mnote-data-pentax.h +++ b/src/libexif/pentax/exif-mnote-data-pentax.h @@ -1,6 +1,6 @@ /* exif-mnote-data-pentax.h * - * Copyright © 2002 Lutz Müller <lutz@users.sourceforge.net> + * Copyright (c) 2002 Lutz Mueller <lutz@users.sourceforge.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,8 @@ #include <libexif/pentax/mnote-pentax-entry.h> #include <libexif/exif-mem.h> +enum PentaxVersion {pentaxV1 = 1, pentaxV2 = 2, pentaxV3 = 4, casioV2 = 4 }; + typedef struct _ExifMnoteDataPentax ExifMnoteDataPentax; struct _ExifMnoteDataPentax { @@ -37,6 +39,8 @@ struct _ExifMnoteDataPentax { ExifByteOrder order; unsigned int offset; + + enum PentaxVersion version; }; ExifMnoteData *exif_mnote_data_pentax_new (ExifMem *); diff --git a/src/libexif/pentax/mnote-pentax-entry.c b/src/libexif/pentax/mnote-pentax-entry.c index 3469f22..ac15108 100644 --- a/src/libexif/pentax/mnote-pentax-entry.c +++ b/src/libexif/pentax/mnote-pentax-entry.c @@ -1,6 +1,6 @@ /* mnote-pentax-entry.c * - * Copyright © 2002 Lutz Müller <lutz@users.sourceforge.net> + * Copyright (c) 2002 Lutz Mueller <lutz@users.sourceforge.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,37 +34,50 @@ #define CF(format,target,v,maxlen) \ { \ - if (format != target) { \ - snprintf (v, maxlen, \ - _("Invalid format '%s', " \ - "expected '%s'."), \ - exif_format_get_name (format), \ - exif_format_get_name (target)); \ - break; \ - } \ + if (format != target) { \ + snprintf (v, maxlen, \ + _("Invalid format '%s', " \ + "expected '%s'."), \ + exif_format_get_name (format), \ + exif_format_get_name (target)); \ + break; \ + } \ } #define CC(number,target,v,maxlen) \ { \ - if (number != target) { \ - snprintf (v, maxlen, \ - _("Invalid number of components (%i, " \ - "expected %i)."), (int) number, (int) target); \ - break; \ - } \ + if (number != target) { \ + snprintf (v, maxlen, \ + _("Invalid number of components (%i, " \ + "expected %i)."), (int) number, (int) target); \ + break; \ + } \ } -static struct { +#define CC2(number,t1,t2,v,maxlen) \ +{ \ + if ((number != t1) && (number != t2)) { \ + snprintf (v, maxlen, \ + _("Invalid number of components (%i, " \ + "expected %i or %i)."), (int) number, \ + (int) t1, (int) t2); \ + break; \ + } \ +} + +static const struct { ExifTag tag; struct { int index; const char *string; - } elem[7]; + } elem[33]; } items[] = { +#ifndef NO_VERBOSE_TAG_DATA { MNOTE_PENTAX_TAG_MODE, { {0, N_("Auto")}, {1, N_("Night-scene")}, {2, N_("Manual")}, + {4, N_("Multi-exposure")}, {0, NULL}}}, { MNOTE_PENTAX_TAG_QUALITY, { {0, N_("Good")}, @@ -114,6 +127,181 @@ static struct { {2, N_("Black & White")}, {3, N_("Sepia")}, {0, NULL}}}, + { MNOTE_PENTAX2_TAG_MODE, + { {0, N_("Auto")}, + {1, N_("Night-scene")}, + {2, N_("Manual")}, + {4, N_("Multi-exposure")}, + {0, NULL}}}, + { MNOTE_PENTAX2_TAG_QUALITY, + { {0, N_("Good")}, + {1, N_("Better")}, + {2, N_("Best")}, + {3, N_("TIFF")}, + {4, N_("RAW")}, + {0, NULL}}}, + { MNOTE_PENTAX2_TAG_IMAGE_SIZE, + { {0, "640x480"}, + {1, N_("Full")}, + {2, "1024x768"}, + {3, "1280x960"}, + {4, "1600x1200"}, + {5, "2048x1536"}, + {8, N_("2560x1920 or 2304x1728")}, + {9, "3072x2304"}, + {10, "3264x2448"}, + {19, "320x240"}, + {20, "2288x1712"}, + {21, "2592x1944"}, + {22, N_("2304x1728 or 2592x1944")}, + {23, "3056x2296"}, + {25, N_("2816x2212 or 2816x2112")}, + {27, "3648x2736"}, + {36, "3008x2008"}, + {0, NULL}}}, + { MNOTE_PENTAX2_TAG_PICTURE_MODE, + { {0, N_("Program")}, + {2, N_("Program AE")}, + {3, N_("Manual")}, + {5, N_("Portrait")}, + {6, N_("Landscape")}, + {8, N_("Sport")}, + {9, N_("Night Scene")}, + {11, N_("Soft")}, + {12, N_("Surf & Snow")}, + {13, N_("Sunset or Candlelight")}, + {14, N_("Autumn")}, + {15, N_("Macro")}, + {17, N_("Fireworks")}, + {18, N_("Text")}, + {19, N_("Panorama")}, + {30, N_("Self Portrait")}, + {31, N_("Illustrations")}, + {33, N_("Digital Filter")}, + {37, N_("Museum")}, + {38, N_("Food")}, + {40, N_("Green Mode")}, + {49, N_("Light Pet")}, + {50, N_("Dark Pet")}, + {51, N_("Medium Pet")}, + {53, N_("Underwater")}, + {54, N_("Candlelight")}, + {55, N_("Natural Skin Tone")}, + {56, N_("Synchro Sound Record")}, + {58, N_("Frame Composite")}, + {0, NULL}}}, + { MNOTE_PENTAX2_TAG_FLASH_MODE, + { {0x0000, N_("Auto, Did not fire")}, + {0x0001, N_("Off")}, + {0x0003, N_("Auto, Did not fire, Red-eye reduction")}, + {0x0100, N_("Auto, Fired")}, + {0x0102, N_("On")}, + {0x0103, N_("Auto, Fired, Red-eye reduction")}, + {0x0104, N_("On, Red-eye reduction")}, + {0x0105, N_("On, Wireless")}, + {0x0108, N_("On, Soft")}, + {0x0109, N_("On, Slow-sync")}, + {0x010a, N_("On, Slow-sync, Red-eye reduction")}, + {0x010b, N_("On, Trailing-curtain Sync")}, + {0, NULL}}}, + { MNOTE_PENTAX2_TAG_FOCUS_MODE, + { {0, N_("Normal")}, + {1, N_("Macro")}, + {2, N_("Infinity")}, + {3, N_("Manual")}, + {5, N_("Pan Focus")}, + {16, N_("AF-S")}, + {17, N_("AF-C")}, + {0, NULL}}}, + { MNOTE_PENTAX2_TAG_AFPOINT_SELECTED, + { {1, N_("Upper-left")}, + {2, N_("Top")}, + {3, N_("Upper-right")}, + {4, N_("Left")}, + {5, N_("Mid-left")}, + {6, N_("Center")}, + {7, N_("Mid-right")}, + {8, N_("Right")}, + {9, N_("Lower-left")}, + {10, N_("Bottom")}, + {11, N_("Lower-right")}, + {0xfffe, N_("Fixed Center")}, + {0xffff, N_("Auto")}, + {0, NULL}}}, + { MNOTE_PENTAX2_TAG_AUTO_AFPOINT, + { {0, N_("Multiple")}, + {1, N_("Top-left")}, + {2, N_("Top-center")}, + {3, N_("Top-right")}, + {4, N_("Left")}, + {5, N_("Center")}, + {6, N_("Right")}, + {7, N_("Bottom-left")}, + {8, N_("Bottom-center")}, + {9, N_("Bottom-right")}, + {0xffff, N_("None")}, + {0, NULL}}}, + { MNOTE_PENTAX2_TAG_WHITE_BALANCE, + { {0, N_("Auto")}, + {1, N_("Daylight")}, + {2, N_("Shade")}, + {3, N_("Fluorescent")}, + {4, N_("Tungsten")}, + {5, N_("Manual")}, + {6, N_("Daylight Fluorescent")}, + {7, N_("Daywhite Fluorescent")}, + {8, N_("White Fluorescent")}, + {9, N_("Flash")}, + {10, N_("Cloudy")}, + {0xfffe, N_("Unknown")}, + {0xffff, N_("User Selected")}, + {0, NULL}}}, + {MNOTE_CASIO2_TAG_BESTSHOT_MODE, + { {0, N_("Off")}, + {1, N_("On")}, + {0, NULL}}}, +#endif + {0, {{0, NULL}}} +}; + +/* Two-component values */ +static const struct { + ExifTag tag; + struct { + int index1, index2; + const char *string; + } elem[39]; +} items2[] = { +#ifndef NO_VERBOSE_TAG_DATA + { MNOTE_PENTAX2_TAG_IMAGE_SIZE, + { {0, 0, "2304x1728"}, + {4, 0, "1600x1200"}, + {5, 0, "2048x1536"}, + {8, 0, "2560x1920"}, + {34, 0, "1536x1024"}, + {36, 0, N_("3008x2008 or 3040x2024")}, + {37, 0, "3008x2000"}, + {35, 1, "2400x1600"}, + {32, 2, "960x480"}, + {33, 2, "1152x768"}, + {34, 2, "1536x1024"}, + {0, 0, NULL}}}, + { MNOTE_PENTAX2_TAG_PICTURE_MODE, + { {0, 0, N_("Auto")}, + {5, 0, N_("Portrait")}, + {53, 0, N_("Underwater")}, + {255, 0, N_("Digital Filter?")}, + {5, 1, N_("Portrait")}, + {9, 1, N_("Night Scene")}, + {13, 1, N_("Candlelight")}, + {15, 1, N_("Macro")}, + {53, 1, N_("Underwater")}, + {0, 2, N_("Program AE")}, + {5, 2, N_("Portrait")}, + {6, 2, N_("Landscape")}, + {0, 0, NULL}}}, +#endif + {0, {{0, 0, NULL}}} }; char * @@ -121,7 +309,7 @@ mnote_pentax_entry_get_value (MnotePentaxEntry *entry, char *val, unsigned int maxlen) { ExifLong vl; - ExifShort vs; + ExifShort vs, vs2; int i = 0, j = 0; if (!entry) return (NULL); @@ -140,26 +328,63 @@ mnote_pentax_entry_get_value (MnotePentaxEntry *entry, case MNOTE_PENTAX_TAG_SATURATION: case MNOTE_PENTAX_TAG_ISO_SPEED: case MNOTE_PENTAX_TAG_COLOR: + case MNOTE_PENTAX2_TAG_MODE: + case MNOTE_PENTAX2_TAG_QUALITY: + case MNOTE_PENTAX2_TAG_FLASH_MODE: + case MNOTE_PENTAX2_TAG_FOCUS_MODE: + case MNOTE_PENTAX2_TAG_AFPOINT_SELECTED: + case MNOTE_PENTAX2_TAG_AUTO_AFPOINT: + case MNOTE_PENTAX2_TAG_WHITE_BALANCE: + case MNOTE_PENTAX2_TAG_PICTURE_MODE: + case MNOTE_PENTAX2_TAG_IMAGE_SIZE: + case MNOTE_CASIO2_TAG_BESTSHOT_MODE: CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen); - CC (entry->components, 1, val, maxlen); - vs = exif_get_short (entry->data, entry->order); + CC2 (entry->components, 1, 2, val, maxlen); + if (entry->components == 1) { + vs = exif_get_short (entry->data, entry->order); - /* search the tag */ - for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++); - if (!items[i].tag) { - strncpy (val, "Internal error", maxlen); - break; - } + /* search the tag */ + for (i = 0; (items[i].tag && items[i].tag != entry->tag); i++); + if (!items[i].tag) { + snprintf (val, maxlen, + _("Internal error (unknown value %i)"), vs); + break; + } - /* find the value */ - for (j = 0; items[i].elem[j].string && + /* find the value */ + for (j = 0; items[i].elem[j].string && (items[i].elem[j].index < vs); j++); - if (items[i].elem[j].index != vs) { - snprintf (val, maxlen, - "Internal error (unknown value %i)", vs); - break; + if (items[i].elem[j].index != vs) { + snprintf (val, maxlen, + _("Internal error (unknown value %i)"), vs); + break; + } + strncpy (val, _(items[i].elem[j].string), maxlen); + } else { + /* Two-component values */ + CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen); + CC2 (entry->components, 1, 2, val, maxlen); + vs = exif_get_short (entry->data, entry->order); + vs2 = exif_get_short (entry->data+2, entry->order) << 16; + + /* search the tag */ + for (i = 0; (items2[i].tag && items2[i].tag != entry->tag); i++); + if (!items2[i].tag) { + snprintf (val, maxlen, + _("Internal error (unknown value %i %i)"), vs, vs2); + break; + } + + /* find the value */ + for (j = 0; items2[i].elem[j].string && ((items2[i].elem[j].index2 < vs2) + || ((items2[i].elem[j].index2 == vs2) && (items2[i].elem[j].index1 < vs))); j++); + if ((items2[i].elem[j].index1 != vs) || (items2[i].elem[j].index2 != vs2)) { + snprintf (val, maxlen, + _("Internal error (unknown value %i %i)"), vs, vs2); + break; + } + strncpy (val, _(items2[i].elem[j].string), maxlen); } - snprintf (val, maxlen, "%s", items[i].elem[j].string); break; case MNOTE_PENTAX_TAG_ZOOM: @@ -171,23 +396,23 @@ mnote_pentax_entry_get_value (MnotePentaxEntry *entry, case MNOTE_PENTAX_TAG_PRINTIM: CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen); CC (entry->components, 124, val, maxlen); - snprintf (val, maxlen, "%li bytes unknown data", - entry->components); + snprintf (val, maxlen, _("%i bytes unknown data"), + entry->size); break; case MNOTE_PENTAX_TAG_TZ_CITY: CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen); CC (entry->components, 4, val, maxlen); - snprintf (val, entry->components, "%s", entry->data); + strncpy (val, (char*)entry->data, MIN(maxlen, entry->size)); break; case MNOTE_PENTAX_TAG_TZ_DST: CF (entry->format, EXIF_FORMAT_UNDEFINED, val, maxlen); CC (entry->components, 4, val, maxlen); - snprintf (val, entry->components, "%s", entry->data); + strncpy (val, (char*)entry->data, MIN(maxlen, entry->size)); break; default: switch (entry->format) { case EXIF_FORMAT_ASCII: - strncpy (val, entry->data, MIN(maxlen, entry->components)); + strncpy (val, (char *)entry->data, MIN(maxlen, entry->size)); break; case EXIF_FORMAT_SHORT: vs = exif_get_short (entry->data, entry->order); @@ -199,8 +424,8 @@ mnote_pentax_entry_get_value (MnotePentaxEntry *entry, break; case EXIF_FORMAT_UNDEFINED: default: - snprintf (val, maxlen, "%li bytes unknown data", - entry->components); + snprintf (val, maxlen, _("%i bytes unknown data"), + entry->size); break; } break; diff --git a/src/libexif/pentax/mnote-pentax-entry.h b/src/libexif/pentax/mnote-pentax-entry.h index 628d5dd..a7025e6 100644 --- a/src/libexif/pentax/mnote-pentax-entry.h +++ b/src/libexif/pentax/mnote-pentax-entry.h @@ -1,6 +1,6 @@ /* mnote-pentax-entry.h * - * Copyright © 2002 Lutz Müller <lutz@users.sourceforge.net> + * Copyright (c) 2002 Lutz Mueller <lutz@users.sourceforge.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/libexif/pentax/mnote-pentax-tag.c b/src/libexif/pentax/mnote-pentax-tag.c index 76823a4..dd06cd9 100644 --- a/src/libexif/pentax/mnote-pentax-tag.c +++ b/src/libexif/pentax/mnote-pentax-tag.c @@ -1,6 +1,6 @@ /* mnote-pentax-tag.c: * - * Copyright © 2002 Lutz Müller <lutz@users.sourceforge.net> + * Copyright (c) 2002 Lutz Mueller <lutz@users.sourceforge.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,39 +25,53 @@ #include <libexif/i18n.h> -static struct { +static const struct { MnotePentaxTag tag; const char *name; const char *title; const char *description; } table[] = { - {MNOTE_PENTAX_TAG_MODE, "Mode", N_("Capture Mode"), NULL}, - {MNOTE_PENTAX_TAG_QUALITY, "Quality", N_("Quality Level"), NULL}, - {MNOTE_PENTAX_TAG_FOCUS, "Focus", N_("Focus Mode"), NULL}, - {MNOTE_PENTAX_TAG_FLASH, "Flash", N_("Flash Mode"), NULL}, +#ifndef NO_VERBOSE_TAG_STRINGS + {MNOTE_PENTAX_TAG_MODE, "Mode", N_("Capture Mode"), ""}, + {MNOTE_PENTAX_TAG_QUALITY, "Quality", N_("Quality Level"), ""}, + {MNOTE_PENTAX_TAG_FOCUS, "Focus", N_("Focus Mode"), ""}, + {MNOTE_PENTAX_TAG_FLASH, "Flash", N_("Flash Mode"), ""}, {MNOTE_PENTAX_TAG_UNKNOWN_05, NULL, NULL, NULL}, {MNOTE_PENTAX_TAG_UNKNOWN_06, NULL, NULL, NULL}, - {MNOTE_PENTAX_TAG_WHITE_BALANCE, "WhiteBalance", N_("White Balance"), NULL}, + {MNOTE_PENTAX_TAG_WHITE_BALANCE, "WhiteBalance", N_("White Balance"), ""}, {MNOTE_PENTAX_TAG_UNKNOWN_08, NULL, NULL, NULL}, {MNOTE_PENTAX_TAG_UNKNOWN_09, NULL, NULL, NULL}, {MNOTE_PENTAX_TAG_ZOOM, "Zoom", N_("Zoom"), NULL}, - {MNOTE_PENTAX_TAG_SHARPNESS, "Sharpness", N_("Sharpness"), NULL}, - {MNOTE_PENTAX_TAG_CONTRAST, "Contrast", N_("Contrast"), NULL}, - {MNOTE_PENTAX_TAG_SATURATION, "Saturation", N_("Saturation"), NULL}, + {MNOTE_PENTAX_TAG_SHARPNESS, "Sharpness", N_("Sharpness"), ""}, + {MNOTE_PENTAX_TAG_CONTRAST, "Contrast", N_("Contrast"), ""}, + {MNOTE_PENTAX_TAG_SATURATION, "Saturation", N_("Saturation"), ""}, {MNOTE_PENTAX_TAG_UNKNOWN_14, NULL, NULL, NULL}, {MNOTE_PENTAX_TAG_UNKNOWN_15, NULL, NULL, NULL}, {MNOTE_PENTAX_TAG_UNKNOWN_16, NULL, NULL, NULL}, {MNOTE_PENTAX_TAG_UNKNOWN_17, NULL, NULL, NULL}, {MNOTE_PENTAX_TAG_UNKNOWN_18, NULL, NULL, NULL}, {MNOTE_PENTAX_TAG_UNKNOWN_19, NULL, NULL, NULL}, - {MNOTE_PENTAX_TAG_ISO_SPEED, "ISOSpeed", N_("ISOSpeed"), NULL}, + {MNOTE_PENTAX_TAG_ISO_SPEED, "ISOSpeed", N_("ISOSpeed"), ""}, {MNOTE_PENTAX_TAG_UNKNOWN_21, NULL, NULL, NULL}, - {MNOTE_PENTAX_TAG_COLOR, "Color", N_("Color"), NULL}, + {MNOTE_PENTAX_TAG_COLOR, "Color", N_("Colors"), ""}, {MNOTE_PENTAX_TAG_UNKNOWN_24, NULL, NULL, NULL}, {MNOTE_PENTAX_TAG_UNKNOWN_25, NULL, NULL, NULL}, - {MNOTE_PENTAX_TAG_PRINTIM, "PrintIM", N_("PrintIM Settings"), NULL}, - {MNOTE_PENTAX_TAG_TZ_CITY, "TimeZone", N_("TimeZone"), NULL}, - {MNOTE_PENTAX_TAG_TZ_DST, "DaylightSavings", N_("DaylightSavings"), NULL}, + {MNOTE_PENTAX_TAG_PRINTIM, "PrintIM", N_("PrintIM Settings"), ""}, + {MNOTE_PENTAX_TAG_TZ_CITY, "TimeZone", N_("Time Zone"), ""}, + {MNOTE_PENTAX_TAG_TZ_DST, "DaylightSavings", N_("Daylight Savings"), ""}, + {MNOTE_PENTAX2_TAG_MODE, "Mode", N_("Capture Mode"), ""}, + {MNOTE_PENTAX2_TAG_QUALITY, "Quality", N_("Quality Level"), ""}, + {MNOTE_PENTAX2_TAG_IMAGE_SIZE, "ImageSize", N_("Image Size"), ""}, + {MNOTE_PENTAX2_TAG_PICTURE_MODE, "PictureMode", N_("PictureMode"), ""}, + {MNOTE_PENTAX2_TAG_FLASH_MODE, "FlashMode", N_("Flash Mode"), ""}, + {MNOTE_PENTAX2_TAG_FOCUS_MODE, "FocusMode", N_("Focus Mode"), ""}, + {MNOTE_PENTAX2_TAG_AFPOINT_SELECTED, "AFPointSelected", N_("AF Point Selected"), ""}, + {MNOTE_PENTAX2_TAG_AUTO_AFPOINT, "AutoAFPoint", N_("Auto AF Point"), ""}, + {MNOTE_PENTAX2_TAG_WHITE_BALANCE, "WhiteBalance", N_("White Balance"), ""}, + {MNOTE_CASIO2_TAG_OBJECT_DISTANCE, "ObjectDistance", N_("Object Distance"), N_("Distance of photographed object in millimeters.")}, + {MNOTE_CASIO2_TAG_TIME_ZONE, "TimeZone", N_("Time Zone"), ""}, + {MNOTE_CASIO2_TAG_BESTSHOT_MODE, "BestshotMode", N_("Bestshot mode"), ""}, +#endif {0, NULL, NULL, NULL} }; @@ -89,6 +103,10 @@ mnote_pentax_tag_get_description (MnotePentaxTag t) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); for (i = 0; i < sizeof (table) / sizeof (table[0]); i++) - if (table[i].tag == t) return (_(table[i].description)); + if (table[i].tag == t) { + if (!table[i].description || !*table[i].description) + return ""; + return (_(table[i].description)); + } return NULL; } diff --git a/src/libexif/pentax/mnote-pentax-tag.h b/src/libexif/pentax/mnote-pentax-tag.h index a261102..872222b 100644 --- a/src/libexif/pentax/mnote-pentax-tag.h +++ b/src/libexif/pentax/mnote-pentax-tag.h @@ -1,6 +1,6 @@ /* mnote-pentax-tag.h * - * Copyright © 2002, 2003 Lutz Mueller <lutz@users.sourceforge.net> + * Copyright (c) 2002, 2003 Lutz Mueller <lutz@users.sourceforge.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -59,7 +59,86 @@ enum _MnotePentaxTag { MNOTE_PENTAX_TAG_UNKNOWN_25 = 0x0019, MNOTE_PENTAX_TAG_PRINTIM = 0x0e00, MNOTE_PENTAX_TAG_TZ_CITY = 0x1000, - MNOTE_PENTAX_TAG_TZ_DST = 0x1001 + MNOTE_PENTAX_TAG_TZ_DST = 0x1001, + + /* Pentax v2, v3: real values + our proprietary base to distinguish from v1 */ + MNOTE_PENTAX2_TAG_BASE = 0x4000, + MNOTE_PENTAX2_TAG_MODE = 0x0001 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_PREVIEW_SIZE = 0x0002 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_PREVIEW_LENGTH = 0x0003 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_PREVIEW_START = 0x0004 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_MODEL_ID = 0x0005 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_DATE = 0x0006 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_TIME = 0x0007 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_QUALITY = 0x0008 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_IMAGE_SIZE = 0x0009 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_PICTURE_MODE = 0x000b + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_FLASH_MODE = 0x000c + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_FOCUS_MODE = 0x000d + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_AFPOINT_SELECTED = 0x000e + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_AUTO_AFPOINT = 0x000f + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_FOCUS_POSITION = 0x0010 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_EXPOSURE_TIME = 0x0012 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_FNUMBER = 0x0013 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_ISO = 0x0014 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_EXPOSURE_COMPENSATION = 0x0016 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_METERING_MODE = 0x0017 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_AUTO_BRACKETING = 0x0018 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_WHITE_BALANCE = 0x0019 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_WHITE_BALANCE_MODE= 0x001a + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_BLUE_BALANCE = 0x001b + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_RED_BALANCE = 0x001c + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_FOCAL_LENGTH = 0x001d + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_DIGITAL_ZOOM = 0x001e + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_SATURATION = 0x001f + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_CONTRAST = 0x0020 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_SHARPNESS = 0x0021 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_WORLDTIME_LOCATION = 0x0022 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_HOMETOWN_CITY = 0x0023 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_DESTINATION_CITY = 0x0024 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_HOMETOWN_DST = 0x0025 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_DESTINATION_DST = 0x0026 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_FRAME_NUMBER = 0x0029 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_IMAGE_PROCESSING = 0x0032 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_PICTURE_MODE2 = 0x0033 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_DRIVE_MODE = 0x0034 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_COLOR_SPACE = 0x0037 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_IMAGE_AREA_OFFSET = 0x0038 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_RAW_IMAGE_SIZE = 0x0039 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_AFPOINTS_USED = 0x003c + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_LENS_TYPE = 0x003f + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_CAMERA_TEMPERATURE = 0x0047 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_NOISE_REDUCTION = 0x0049 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_FLASH_EXPOSURE_COMP = 0x004d + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_IMAGE_TONE = 0x004f + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_SHAKE_REDUCTION_INFO = 0x005c + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_BLACK_POINT = 0x0200 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_WHITE_POINT = 0x0201 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_AE_INFO = 0x0206 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_LENS_INFO = 0x0207 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_FLASH_INFO = 0x0208 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_CAMERA_INFO = 0x0215 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_BATTERY_INFO = 0x0216 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_HOMETOWN_CITY_CODE = 0x1000 + MNOTE_PENTAX2_TAG_BASE, + MNOTE_PENTAX2_TAG_DESTINATION_CITY_CODE = 0x1001 + MNOTE_PENTAX2_TAG_BASE, + + /* Casio v2: some Casio v2 tags match Pentax v2 tags */ + MNOTE_CASIO2_TAG_BASE = MNOTE_PENTAX2_TAG_BASE, + MNOTE_CASIO2_TAG_PREVIEW_START = 0x2000 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_WHITE_BALANCE_BIAS = 0x2011 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_WHITE_BALANCE = 0x2012 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_OBJECT_DISTANCE = 0x2022 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_FLASH_DISTANCE = 0x2034 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_RECORD_MODE = 0x3000 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_SELF_TIMER = 0x3001 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_QUALITY = 0x3002 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_FOCUS_MODE = 0x3003 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_TIME_ZONE = 0x3006 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_BESTSHOT_MODE = 0x3007 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_CCS_ISO_SENSITIVITY = 0x3014 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_COLOR_MODE = 0x3015 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_ENHANCEMENT = 0x3016 + MNOTE_CASIO2_TAG_BASE, + MNOTE_CASIO2_TAG_FINER = 0x3017 + MNOTE_CASIO2_TAG_BASE }; typedef enum _MnotePentaxTag MnotePentaxTag; |