33 #define CF(format,target,v,maxlen) \
35 if (format != target) { \
36 snprintf (v, maxlen, \
37 _("Invalid format '%s', " \
39 exif_format_get_name (format), \
40 exif_format_get_name (target)); \
45 #define CF2(format,target1,target2,v,maxlen) \
47 if ((format != target1) && (format != target2)) { \
48 snprintf (v, maxlen, \
49 _("Invalid format '%s', " \
50 "expected '%s' or '%s'."), \
51 exif_format_get_name (format), \
52 exif_format_get_name (target1), \
53 exif_format_get_name (target2)); \
58 #define CC(number,target,v,maxlen) \
60 if (number != target) { \
61 snprintf (v, maxlen, \
62 _("Invalid number of components (%i, " \
63 "expected %i)."), (int) number, (int) target); \
68 #define CC2(number,t1,t2,v,maxlen) \
70 if ((number < t1) || (number > t2)) { \
71 snprintf (v, maxlen, \
72 _("Invalid number of components (%i, " \
73 "expected %i or %i)."), (int) number, \
74 (int) t1, (int) t2); \
79 #define R2L(n) ((n).denominator ? (long)(n).numerator/(n).denominator : 0L)
80 #define R2D(n) ((n).denominator ? (double)(n).numerator/(n).denominator : 0.0)
90 #ifndef NO_VERBOSE_TAG_DATA
92 { {0,
N_(
"AF non D lens")},
94 {2,
N_(
"AF-D or AF-S lens")},
95 {6,
N_(
"AF-D G lens")},
96 {10,
N_(
"AF-D VR lens")},
97 {14,
N_(
"AF-D G VR lens")},
100 { {0,
N_(
"Flash did not fire")},
101 {4,
N_(
"Flash unit unknown")},
102 {7,
N_(
"Flash is external")},
103 {9,
N_(
"Flash is on camera")},
106 { {1,
N_(
"VGA basic")},
107 {2,
N_(
"VGA normal")},
109 {4,
N_(
"SXGA basic")},
110 {5,
N_(
"SXGA normal")},
111 {6,
N_(
"SXGA fine")},
112 {10,
N_(
"2 Mpixel basic")},
113 {11,
N_(
"2 Mpixel normal")},
114 {12,
N_(
"2 Mpixel fine")},
118 {2,
N_(
"Monochrome")},
124 {3,
N_(
"Contrast+")},
125 {4,
N_(
"Contrast-")},
137 {3,
N_(
"Incandescence")},
138 {4,
N_(
"Fluorescence")},
140 {6,
N_(
"SpeedLight")},
143 { {0,
N_(
"No fisheye")},
144 {1,
N_(
"Fisheye on")},
147 { {1,
N_(
"Normal, SQ")},
148 {2,
N_(
"Normal, HQ")},
149 {3,
N_(
"Normal, SHQ")},
150 {4,
N_(
"Normal, RAW")},
151 {5,
N_(
"Normal, SQ1")},
152 {6,
N_(
"Normal, SQ2")},
153 {7,
N_(
"Normal, super high")},
154 {17,
N_(
"Normal, standard")},
155 {0x101,
N_(
"Fine, SQ")},
156 {0x102,
N_(
"Fine, HQ")},
157 {0x103,
N_(
"Fine, SHQ")},
158 {0x104,
N_(
"Fine, RAW")},
159 {0x105,
N_(
"Fine, SQ1")},
160 {0x106,
N_(
"Fine, SQ2")},
161 {0x107,
N_(
"Fine, super high")},
162 {0x201,
N_(
"Super fine, SQ")},
163 {0x202,
N_(
"Super fine, HQ")},
164 {0x203,
N_(
"Super fine, SHQ")},
165 {0x204,
N_(
"Super fine, RAW")},
166 {0x205,
N_(
"Super fine, SQ1")},
167 {0x206,
N_(
"Super fine, SQ2")},
168 {0x207,
N_(
"Super fine, super high")},
169 {0x211,
N_(
"Super fine, high")},
174 {2,
N_(
"Super macro")},
183 {2,
N_(
"On (Preset)")},
187 {1,
N_(
"Red-eye reduction")},
195 {5,
N_(
"Internal + external")},
224 { {0,
N_(
"Interlaced")},
225 {1,
N_(
"Progressive")},
232 {3,
N_(
"Adjust exposure")},
235 { {1,
N_(
"Spot focus")},
236 {2,
N_(
"Normal focus")},
239 { {0,
N_(
"Record while down")},
240 {1,
N_(
"Press start, press stop")},
263 { {0,
N_(
"5 frames/sec")},
264 {1,
N_(
"10 frames/sec")},
265 {2,
N_(
"15 frames/sec")},
266 {3,
N_(
"20 frames/sec")},
269 { 0, 0, { { 0, NULL } } }
288 memset (v, 0, maxlen);
294 if ((!entry->
data) && (entry->
size > 0))
297 switch (entry->
tag) {
304 if ((vl & 0xF0F0F0F0) == 0x30303030) {
305 memcpy (v, entry->
data,
MIN (maxlen, 4));
307 snprintf (v, maxlen,
"%04lx", (
long unsigned int) vl);
315 snprintf (v, maxlen,
"ISO %hd", vs);
322 snprintf (v, maxlen,
"ISO2 %hd", vs);
346 snprintf (v, maxlen,
"%lu", (
long unsigned int) vl );
354 a = (vl>>24)&0xff; b = (vl>>16)&0xff; c = (vl>>8)&0xff;
355 snprintf (v, maxlen,
"%.1f", c?(
double)a*((
double)b/(
double)c):0 );
363 snprintf (v, maxlen,
"%.1f", ((
long unsigned int) vl>>24)/6.0 );
373 snprintf (v, maxlen,
"%hd", vs);
382 snprintf (v, maxlen,
_(
"Red Correction %f, blue Correction %f"), r,b);
389 strncpy (v,
_(
"No manual focus selection"), maxlen);
392 snprintf (v, maxlen,
_(
"%2.2f meters"), r);
402 snprintf (v, maxlen,
"%2.2f x %2.2f um", r, b);
412 snprintf (v, maxlen,
"%hd", vs);
417 switch ( *( entry->
data+1) ) {
418 case 0: strncpy (v,
_(
"AF position: center"), maxlen);
break;
419 case 1: strncpy (v,
_(
"AF position: top"), maxlen);
break;
420 case 2: strncpy (v,
_(
"AF position: bottom"), maxlen);
break;
421 case 3: strncpy (v,
_(
"AF position: left"), maxlen);
break;
422 case 4: strncpy (v,
_(
"AF position: right"), maxlen);
break;
423 case 5: strncpy (v,
_(
"AF position: upper-left"), maxlen);
break;
424 case 6: strncpy (v,
_(
"AF position: upper-right"), maxlen);
break;
425 case 7: strncpy (v,
_(
"AF position: lower-left"), maxlen);
break;
426 case 8: strncpy (v,
_(
"AF position: lower-right"), maxlen);
break;
427 case 9: strncpy (v,
_(
"AF position: far left"), maxlen);
break;
428 case 10: strncpy (v,
_(
"AF position: far right"), maxlen);
break;
429 default: strncpy (v,
_(
"Unknown AF position"), maxlen);
437 for (i = 0; (
items[i].tag &&
items[i].tag != entry->
tag); i++)
440 snprintf (v, maxlen,
_(
"Internal error (unknown value %hi)"), vs);
445 for (j = 0;
items[i].elem[j].string &&
446 (
items[i].elem[j].index < vs); j++);
448 snprintf (v, maxlen,
_(
"Unknown value %hi"), vs);
451 strncpy (v,
_(
items[i].
elem[j].
string), maxlen);
458 strncpy (v,
_(
"None"), maxlen);
461 snprintf (v, maxlen,
"%2.2f", r);
508 for (i = 0; (
items[i].tag &&
items[i].tag != entry->
tag); i++)
511 snprintf (v, maxlen,
_(
"Internal error (unknown value %hi)"), vs);
516 for (j = 0;
items[i].elem[j].string &&
517 (
items[i].elem[j].index < vs); j++);
519 snprintf (v, maxlen,
_(
"Unknown value %hi"), vs);
522 strncpy (v,
_(
items[i].
elem[j].
string), maxlen);
538 strncpy (v,
_(
"Off"), maxlen);
541 strncpy (v,
_(
"On"), maxlen);
544 sprintf (buf,
_(
"Unknown %hu"), vs);
545 strncat (v, buf, maxlen - strlen (v));
555 strncpy (v,
_(
"Off"), maxlen);
558 strncpy (v,
_(
"On"), maxlen);
561 strncpy (v,
_(
"2 sec."), maxlen);
564 sprintf (buf,
_(
"Unknown %hu"), vs);
565 strncat (v, buf, maxlen - strlen (v));
583 snprintf (v, maxlen,
"%ld-%ldmm 1:%3.1f - %3.1f",a,b,c,d);
594 strncpy (v,
_(
"Normal"), maxlen);
597 strncpy (v,
_(
"Unknown"), maxlen);
600 strncpy (v,
_(
"Fast"), maxlen);
603 strncpy (v,
_(
"Panorama"), maxlen);
606 snprintf (v, maxlen,
"%li", (
long int) vl);
609 snprintf (buf,
sizeof (buf),
"/%li/", (
long int) vl);
610 strncat (v, buf, maxlen - strlen (v));
614 strncat (v,
_(
"Left to right"), maxlen - strlen (v));
617 strncat (v,
_(
"Right to left"), maxlen - strlen (v));
620 strncat (v,
_(
"Bottom to top"), maxlen - strlen (v));
623 strncat (v,
_(
"Top to bottom"), maxlen - strlen (v));
626 snprintf (buf,
sizeof (buf),
"%li",
628 strncat (v, buf, maxlen - strlen (v));
636 sprintf (buf,
"%hu", vs);
637 strncat (v, buf, maxlen - strlen (v));
644 sprintf (buf,
"%hd ", vss);
645 strncat (v, buf, maxlen - strlen (v));
654 sprintf (buf,
"%hu ", vs);
655 strncat (v, buf, maxlen - strlen (v));
661 strncpy (v, (
char *)entry->
data,
MIN (maxlen, entry->
size));
665 strncpy (v, (
char *)entry->
data,
MIN (maxlen, entry->
size));
670 strncpy (v, (
char *)entry->
data,
MIN (maxlen, entry->
size));
675 strncpy (v, (
char *)entry->
data,
MIN (maxlen, entry->
size));
682 sprintf (buf,
"%lu ", (
unsigned long)vl);
683 strncat (v, buf, maxlen - strlen (v));
691 strncpy (v,
_(
"Unknown"), maxlen);
695 snprintf (v, maxlen,
"%li mm", tmp);
704 strncpy (v,
_(
"Automatic"), maxlen);
709 unsigned long colorTemp = 0;
734 snprintf (v, maxlen,
_(
"Manual: %liK"), colorTemp);
737 strncpy (v,
_(
"Manual: unknown"), maxlen);
743 strncpy (v,
_(
"One-touch"), maxlen);
746 strncpy (v,
_(
"Unknown"), maxlen);
755 snprintf (v, maxlen,
"%hu ", vs);
757 sprintf (buf,
"%hu", vs);
758 strncat (v, buf, maxlen - strlen (v));
771 sprintf (buf,
"%hu ", vs);
772 strncat (v, buf, maxlen - strlen (v));
785 strncpy (v, (
char *)entry->
data,
MIN (maxlen, entry->
size));
790 snprintf (v, maxlen,
"%hu", vs);
795 snprintf (v, maxlen,
"%hi", vss);
800 snprintf (v, maxlen,
"%lu", (
long unsigned) vl);
805 snprintf (v, maxlen,
"%li", (
long int) vsl);
811 strncpy (v,
_(
"Infinite"), maxlen);
814 snprintf (v, maxlen,
"%2.3f", r);
821 strncpy (v,
_(
"Infinite"), maxlen);
824 snprintf (v, maxlen,
"%2.3f", r);
829 snprintf (v, maxlen,
_(
"%i bytes unknown data: "),
831 for (i = 0; i < (int)entry->
size; i++) {
832 sprintf (buf,
"%02x", entry->
data[i]);
833 strncat (v, buf, maxlen - strlen (v));
@ EXIF_BYTE_ORDER_INTEL
Little-endian byte order.
ExifRational exif_get_rational(const unsigned char *buf, ExifByteOrder order)
Retrieve an ExifRational value from memory.
ExifLong exif_get_long(const unsigned char *buf, ExifByteOrder order)
Retrieve an ExifLong value from memory.
ExifShort exif_get_short(const unsigned char *buf, ExifByteOrder order)
Retrieve an ExifShort value from memory.
ExifSLong exif_get_slong(const unsigned char *b, ExifByteOrder order)
Retrieve an ExifSLong value from memory.
ExifSShort exif_get_sshort(const unsigned char *buf, ExifByteOrder order)
Retrieve an ExifSShort value from memory.
ExifSRational exif_get_srational(const unsigned char *buf, ExifByteOrder order)
Retrieve an ExifSRational value from memory.
EXIF data manipulation functions and types.
uint32_t ExifLong
EXIF Unsigned Long data type.
int32_t ExifSLong
EXIF Signed Long data type.
uint16_t ExifShort
EXIF Unsigned Short data type.
int16_t ExifSShort
EXIF Signed Short data type.
#define CC(number, target, v, maxlen)
static const struct @13 items[]
#define CF(format, target, v, maxlen)
char * mnote_olympus_entry_get_value(MnoteOlympusEntry *entry, char *v, unsigned int maxlen)
#define CC2(number, t1, t2, v, maxlen)
#define CF2(format, target1, target2, v, maxlen)
@ MNOTE_NIKON1_TAG_WHITEBALANCE
@ MNOTE_SANYO_TAG_FLICKERREDUCE
@ MNOTE_NIKON_TAG_IMAGEADJUSTMENT
@ MNOTE_OLYMPUS_TAG_REDBALANCE
@ MNOTE_OLYMPUS_TAG_FOCALPLANEDIAGONAL
@ MNOTE_EPSON_TAG_SOFTWARE
@ MNOTE_OLYMPUS_TAG_FOCUSRANGE
@ MNOTE_OLYMPUS_TAG_EXTERNALFLASHBOUNCE
@ MNOTE_SANYO_TAG_FOCUSMODE
@ MNOTE_SANYO_TAG_QUICKSHOT
@ MNOTE_NIKON_TAG_TOTALPICTURES
@ MNOTE_SANYO_TAG_CCDSENSITIVITY
@ MNOTE_NIKON_TAG_SATURATION2
@ MNOTE_OLYMPUS_TAG_ONETOUCHWB
@ MNOTE_OLYMPUS_TAG_FLASHDEVICE
@ MNOTE_OLYMPUS_TAG_CONTRAST
@ MNOTE_OLYMPUS_TAG_FLASHMODE
@ MNOTE_SANYO_TAG_COLORADJUSTMENTMODE
@ MNOTE_NIKON1_TAG_CCDSENSITIVITY
@ MNOTE_NIKON_TAG_WHITEBALANCERB
@ MNOTE_NIKON1_TAG_IMAGEADJUSTMENT
@ MNOTE_OLYMPUS_TAG_LENSTEMPERATURE
@ MNOTE_NIKON_TAG_ISOSELECTION
@ MNOTE_OLYMPUS_TAG_VERSION
@ MNOTE_NIKON_TAG_SATURATION
@ MNOTE_OLYMPUS_TAG_SHARPNESS
@ MNOTE_NIKON_TAG_COLORMODE
@ MNOTE_SANYO_TAG_SELFTIMER
@ MNOTE_OLYMPUS_TAG_SENSORTEMPERATURE
@ MNOTE_OLYMPUS_TAG_NOISEREDUCTION
@ MNOTE_NIKON_TAG_SENSORPIXELSIZE
@ MNOTE_OLYMPUS_TAG_BWMODE
@ MNOTE_NIKON_TAG_EXPOSUREDIFF
@ MNOTE_OLYMPUS_TAG_QUALITY
@ MNOTE_SANYO_TAG_WIDERANGE
@ MNOTE_OLYMPUS_TAG_MACRO
@ MNOTE_OLYMPUS_TAG_CCDSCANMODE
@ MNOTE_OLYMPUS_TAG_UNKNOWN_4
@ MNOTE_NIKON_TAG_MANUALFOCUSDISTANCE
@ MNOTE_OLYMPUS_TAG_PREVIEWIMAGEVALID
@ MNOTE_OLYMPUS_TAG_COLORMATRIX
@ MNOTE_OLYMPUS_TAG_SERIALNUMBER2
@ MNOTE_NIKON1_TAG_COLORMODE
@ MNOTE_EPSON_TAG_IMAGE_WIDTH
@ MNOTE_NIKON_TAG_FLASHMODE
@ MNOTE_NIKON1_TAG_DIGITALZOOM
@ MNOTE_OLYMPUS_TAG_BLACKLEVEL
@ MNOTE_OLYMPUS_TAG_FOCUSDIST
@ MNOTE_NIKON_TAG_FLASHEXPCOMPENSATION
@ MNOTE_NIKON_TAG_FIRMWARE
@ MNOTE_NIKON1_TAG_CONVERTER
@ MNOTE_SANYO_TAG_VOICEMEMO
@ MNOTE_SANYO_TAG_DIGITALZOOM
@ MNOTE_NIKON_TAG_ADAPTER
@ MNOTE_OLYMPUS_TAG_WBALANCE
@ MNOTE_NIKON_TAG_WHITEBALANCE
@ MNOTE_NIKON_TAG_FLASHEXPOSUREBRACKETVAL
@ MNOTE_OLYMPUS_TAG_MANFOCUS
@ MNOTE_NIKON_TAG_LENSTYPE
@ MNOTE_NIKON_TAG_FLASHUSED
@ MNOTE_OLYMPUS_TAG_BLUEBALANCE
@ MNOTE_NIKON_TAG_QUALITY
@ MNOTE_NIKON_TAG_AFFOCUSPOSITION
@ MNOTE_NIKON_TAG_LENS_FSTOPS
@ MNOTE_SANYO_TAG_RESAVED
@ MNOTE_SANYO_TAG_SEQUENTIALSHOT
@ MNOTE_NIKON_TAG_SHARPENING
@ MNOTE_EPSON_TAG_IMAGE_HEIGHT
@ MNOTE_OLYMPUS_TAG_DIGIZOOM
@ MNOTE_SANYO_TAG_RECORDSHUTTERRELEASE
@ MNOTE_SANYO_TAG_SCENESELECT
@ MNOTE_NIKON_TAG_DIGITALZOOM
@ MNOTE_SANYO_TAG_SEQUENCESHOTINTERVAL
@ MNOTE_NIKON_TAG_BRACKETING
@ MNOTE_OLYMPUS_TAG_LENSDISTORTION
@ MNOTE_NIKON_TAG_FOCUSMODE
@ MNOTE_NIKON1_TAG_QUALITY
@ MNOTE_NIKON_TAG_FLASHSETTING
@ MNOTE_NIKON_TAG_IMAGEBOUNDARY
@ MNOTE_SANYO_TAG_OPTICALZOOM
@ MNOTE_NIKON_TAG_COLORMODE1
@ MNOTE_OLYMPUS_TAG_COLORCONTROL
@ MNOTE_SANYO_TAG_LIGHTSOURCESPECIAL
@ MNOTE_NIKON_TAG_WHITEBALANCEFINE
enum _MnoteOlympusTag MnoteOlympusTag
EXIF Unsigned Rational data type.
EXIF Signed Rational data type.