67
68
#define UNDEFINED 0xFF
70
static struct canon_entry_table_t {
70
71
unsigned int subtag;
75
{ 0, 2, N_("normal")},
76
{ 3, 0, N_("flash did not fire")},
79
{ 3, 3, N_("red eyes reduction")},
80
{ 3, 4, N_("slow synchro")},
81
{ 3, 5, N_("auto + red yes reduction")},
82
{ 3, 6, N_("on + red eyes reduction")},
83
{ 3, 16, N_("external")},
84
{ 4, 0, N_("single or timer")},
85
{ 4, 1, N_("continuous")},
86
{ 6, 0, N_("one-Shot")},
87
{ 6, 1, N_("AI Servo")},
88
{ 6, 2, N_("AI Focus")},
74
} entries_settings_1 [] = {
76
{ 0, 2, N_("Normal")},
77
{ 2, 1, N_("Economy")},
78
{ 2, 2, N_("Normal")},
81
{ 2, 5, N_("Superfine")},
85
{ 3, 3, N_("Red-eye reduction")},
86
{ 3, 4, N_("Slow synchro")},
87
{ 3, 5, N_("Auto + Red-eye reduction")},
88
{ 3, 6, N_("On + Red-eye reduction")},
89
{ 3, 16, N_("External flash")},
90
{ 4, 0, N_("Single")},
91
{ 4, 1, N_("Continuous")},
93
{ 4, 3, N_("Continuous, speed priority")},
94
{ 4, 4, N_("Continuous, low")},
95
{ 4, 5, N_("Continuous, high")},
96
{ 6, 0, N_("One-shot AF")},
97
{ 6, 1, N_("AI servo AF")},
98
{ 6, 2, N_("AI focus AF")},
99
{ 6, 3, N_("Manual focus")},
90
100
{ 6, 4, N_("Single")},
91
101
{ 6, 5, N_("Continuous")},
94
{ 9, 1, N_("medium")},
96
{10, 0, N_("full auto")},
97
{10, 1, N_("manual")},
98
{10, 2, N_("landscape")},
99
{10, 3, N_("fast shutter")},
100
{10, 4, N_("slow shutter")},
101
{10, 5, N_("night")},
102
{10, 6, N_("Black & White")},
102
{ 6, 6, N_("Manual focus")},
103
{ 6, 16, N_("Pan focus")},
104
{ 9, 0, N_("Large")},
105
{ 9, 1, N_("Medium")},
106
{ 9, 2, N_("Small")},
107
{ 9, 5, N_("Medium 1")},
108
{ 9, 6, N_("Medium 2")},
109
{ 9, 7, N_("Medium 3")},
110
{10, 0, N_("Full auto")},
111
{10, 1, N_("Manual")},
112
{10, 2, N_("Landscape")},
113
{10, 3, N_("Fast shutter")},
114
{10, 4, N_("Slow shutter")},
115
{10, 5, N_("Night")},
116
{10, 6, N_("Grayscale")},
103
117
{10, 7, N_("Sepia")},
104
118
{10, 8, N_("Portrait")},
105
119
{10, 9, N_("Sports")},
106
{10, 10, N_("Macro / Close-Up")},
107
{10, 11, N_("Pan Focus")},
108
{12, 0x0000, N_("normal")},
109
{12, 0x0001, N_("high")},
110
{12, 0xffff, N_("low")},
111
{13, 0x0000, N_("normal")},
112
{13, 0x0001, N_("high")},
113
{13, 0xffff, N_("low")},
114
{14, 0x0000, N_("normal")},
115
{14, 0x0001, N_("high")},
116
{14, 0xffff, N_("low")},
117
{15, 15, N_("auto")},
120
{10, 10, N_("Macro")},
121
{10, 11, N_("Black & white")},
122
{10, 12, N_("Pan focus")},
123
{10, 13, N_("Vivid")},
124
{10, 14, N_("Neutral")},
125
{10, 15, N_("Flash off")},
126
{10, 16, N_("Long shutter")},
127
{10, 17, N_("Super macro")},
128
{10, 18, N_("Foliage")},
129
{10, 19, N_("Indoor")},
130
{10, 20, N_("Fireworks")},
131
{10, 21, N_("Beach")},
132
{10, 22, N_("Underwater")},
133
{10, 23, N_("Snow")},
134
{10, 24, N_("Kids & pets")},
135
{10, 25, N_("Night snapshot")},
136
{10, 26, N_("Digital macro")},
137
{10, 27, N_("My colors")},
138
{10, 28, N_("Still image")},
142
{11, 3, N_("Other")},
143
{12, 0x0000, N_("Normal")},
144
{12, 0x0001, N_("High")},
145
{12, 0xffff, N_("Low")},
146
{13, 0x0000, N_("Normal")},
147
{13, 0x0001, N_("High")},
148
{13, 0xffff, N_("Low")},
149
{14, 0x0000, N_("Normal")},
150
{14, 0x0001, N_("High")},
151
{14, 0xffff, N_("Low")},
152
{15, 14, N_("Auto high")},
153
{15, 15, N_("Auto")},
118
154
{15, 16, N_("50")},
119
155
{15, 17, N_("100")},
120
156
{15, 18, N_("200")},
121
157
{15, 19, N_("400")},
122
{16, 3, N_("evaluative")},
123
{16, 4, N_("partial")},
124
{16, 5, N_("center-weighted")},
125
{18, 0x3000, N_("none (manual focus)")},
126
{18, 0x3001, N_("auto-selected")},
127
{18, 0x3002, N_("right")},
128
{18, 0x3003, N_("center")},
129
{18, 0x3004, N_("left")},
130
{19, 0, N_("easy shooting")},
131
{19, 1, N_("program")},
159
{16, 0, N_("Default")},
161
{16, 2, N_("Average")},
162
{16, 3, N_("Evaluative")},
163
{16, 4, N_("Partial")},
164
{16, 5, N_("Center-weighted average")},
165
{17, 0, N_("Manual")},
167
{17, 2, N_("Not known")},
168
{17, 3, N_("Macro")},
169
{17, 4, N_("Very close")},
170
{17, 5, N_("Close")},
171
{17, 6, N_("Middle range")},
172
{17, 7, N_("Far range")},
173
{17, 8, N_("Pan focus")},
174
{17, 9, N_("Super macro")},
175
{17, 10, N_("Infinity")},
176
{18, 0x2005, N_("Manual AF point selection")},
177
{18, 0x3000, N_("None (MF)")},
178
{18, 0x3001, N_("Auto-selected")},
179
{18, 0x3002, N_("Right")},
180
{18, 0x3003, N_("Center")},
181
{18, 0x3004, N_("Left")},
182
{18, 0x4001, N_("Auto AF point selection")},
183
{19, 0, N_("Easy shooting")},
184
{19, 1, N_("Program")},
132
185
{19, 2, N_("Tv-priority")},
133
186
{19, 3, N_("Av-priority")},
134
{19, 4, N_("manual")},
187
{19, 4, N_("Manual")},
135
188
{19, 5, N_("A-DEP")},
189
{19, 6, N_("M-DEP")},
136
190
{21, 0x001, N_("Canon EF 50mm f/1.8")},
137
191
{21, 0x002, N_("Canon EF 28mm f/2.8")},
138
192
{21, 0x004, N_("Sigma UC Zoom 35-135mm f/4-5.6")},
184
238
{21, 0x229, N_("Canon EF 16-35mm f/2.8L")},
185
239
{21, 0x230, N_("Canon EF 24-70mm f/2.8L")},
186
240
{21, 0x231, N_("Canon EF 17-40mm f/4L")},
187
{31, 0, N_("single")},
188
{31, 1, N_("continuous")},
241
{28, 0, N_("Manual")},
243
{28, 2, N_("A-TTL")},
244
{28, 3, N_("E-TTL")},
245
{28, 4, N_("FP sync enabled")},
246
{28, 7, N_("2nd-curtain sync used")},
247
{28, 11, N_("FP sync used")},
248
{28, 13, N_("Internal")},
249
{28, 14, N_("External")},
250
{31, 0, N_("Single")},
251
{31, 1, N_("Continuous")},
252
{32, 0, N_("Normal AE")},
253
{32, 1, N_("Exposure compensation")},
254
{32, 2, N_("AE lock")},
255
{32, 3, N_("AE lock + Exposure compensation")},
256
{32, 4, N_("No AE")},
259
{33, 2, N_("On, shot only")},
261
{39, 1, N_("Vivid")},
262
{39, 2, N_("Neutral")},
263
{39, 3, N_("Smooth")},
264
{39, 4, N_("Sepia")},
265
{39, 5, N_("Black & white")},
266
{39, 6, N_("Custom")},
267
{39, 100, N_("My color data")},
269
{40, 0x0500, N_("Full")},
270
{40, 0x0502, N_("2/3")},
271
{40, 0x0504, N_("1/3")},
274
entries_focal_length [] = {
279
entries_settings_2 [] = {
281
{ 6, 1, N_("Sunny")},
282
{ 6, 2, N_("Cloudy")},
283
{ 6, 3, N_("Tungsten")},
284
{ 6, 4, N_("Fluorescent")},
285
{ 6, 5, N_("Flash")},
286
{ 6, 6, N_("Custom")},
287
{ 6, 7, N_("Black & white")},
288
{ 6, 8, N_("Shade")},
289
{ 6, 9, N_("Manual temperature (Kelvin)")},
290
{ 6, 10, N_("PC set 1")},
291
{ 6, 11, N_("PC set 2")},
292
{ 6, 12, N_("PC set 3")},
293
{ 6, 14, N_("Daylight fluorescent")},
294
{ 6, 15, N_("Custom 1")},
295
{ 6, 16, N_("Custom 2")},
296
{ 6, 17, N_("Underwater")},
298
{ 7, 1, N_("Night scene")},
301
{ 13, 0x3000, N_("None (MF)")},
302
{ 13, 0x3001, N_("Right")},
303
{ 13, 0x3002, N_("Center")},
304
{ 13, 0x3003, N_("Center + Right")},
305
{ 13, 0x3004, N_("Left")},
306
{ 13, 0x3005, N_("Left + Right")},
307
{ 13, 0x3006, N_("Left + Center")},
308
{ 13, 0x3007, N_("All")},
310
{ 15, 1, N_("On (shot 1)")},
311
{ 15, 2, N_("On (shot 2)")},
312
{ 15, 3, N_("On (shot 3)")},
313
{ 15, 0xffff, N_("On")},
314
{ 25, 248, N_("EOS high-end")},
315
{ 25, 250, N_("Compact")},
316
{ 25, 252, N_("EOS mid-range")},
317
{ 26, 0, N_("None")},
318
{ 26, 1, N_("Rotate 90 CW")},
319
{ 26, 2, N_("Rotate 180")},
320
{ 26, 3, N_("Rotate 270 CW")},
321
{ 26, 0xffff, N_("Rotated by software")},
325
{32, 0x0014, N_("1/3")},
326
{32, 0x008c, N_("2/3")},
327
{32, 0x07d0, N_("Full")},
330
entries_panorama [] = {
331
{0, 0, N_("Left to right")},
332
{0, 1, N_("Right to left")},
333
{0, 2, N_("Bottom to top")},
334
{0, 3, N_("Top to bottom")},
335
{0, 4, N_("2x2 matrix (clockwise)")},
340
canon_search_table_value (struct canon_entry_table_t table[],
341
unsigned int t, ExifShort vs, char *val, unsigned int maxlen)
345
/* Search the table for the first matching subtag and value. */
346
for (j = 0; table[j].name && ((table[j].subtag < t) ||
347
((table[j].subtag == t) && table[j].value <= vs)); j++) {
348
if ((table[j].subtag == t) && (table[j].value == vs)) {
352
if ((table[j].subtag == t) && (table[j].value == vs) && table[j].name) {
353
/* Matching subtag and value found. */
354
strncpy (val, table[j].name, maxlen);
356
/* No matching subtag and/or value found. */
357
snprintf (val, maxlen, "0x%04x", vs);
362
canon_search_table_bitfield (struct canon_entry_table_t table[],
363
unsigned int t, ExifShort vs, char *val, unsigned int maxlen)
367
/* Search the table for the first matching subtag. */
368
for (j = 0; table[j].name && (table[j].subtag <= t); j++) {
369
if (table[j].subtag == t) {
373
if ((table[j].subtag == t) && table[j].name) {
374
unsigned int i, bit, lastbit = 0;
377
* Search the table for the last matching bit, because
378
* that one needs no additional comma appended.
380
for (i = j; table[i].name && (table[i].subtag == t); i++) {
381
bit = table[i].value;
382
if ((vs >> bit) & 1) {
386
/* Search the table for all matching bits. */
387
for (i = j; table[i].name && (table[i].subtag == t); i++) {
388
bit = table[i].value;
389
if ((vs >> bit) & 1) {
390
strncat(val, table[i].name, maxlen - strlen (val));
392
strncat (val, N_(", "), maxlen - strlen (val));
396
/* No matching subtag found. */
397
snprintf (val, maxlen, "0x%04x", vs);
193
402
mnote_canon_entry_count_values (const MnoteCanonEntry *entry)
233
470
vs = exif_get_short (entry->data + 2 + t * 2, entry->order);
237
snprintf (buf, sizeof (buf), _("%i (ms)"), vs * 100);
238
strncpy (val, buf, maxlen - strlen (val));
474
strncpy(val, _("Off"), maxlen);
477
snprintf (val, maxlen, _("%i (ms)"), vs * 100);
480
if (((vs & 0xC000) == 0x4000) && (vs != 0x7FFF)) {
481
/* Canon S3 IS - directly specified value */
482
snprintf (val, maxlen, _("%i"), vs & ~0x4000);
484
/* Standard Canon - index into lookup table */
485
canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
242
snprintf (buf, sizeof (buf), "%u", vs);
243
strncpy (val, buf, maxlen - strlen (val));
246
snprintf (buf, sizeof (buf), _("%u mm"), vs);
247
strncpy (val, buf, maxlen - strlen(val));
491
snprintf (val, maxlen, "%u", vs);
495
snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vs / 32.0));
251
strncpy (val, _("External E-TTL"), maxlen - strlen (val));
253
strncpy (val, _("Internal flash"), maxlen - strlen (val));
255
strncpy (val, _("FP sync used"), maxlen - strlen (val));
257
strncpy (val, _("FP sync enabled"), maxlen - strlen (val));
498
canon_search_table_bitfield(entries_settings_1, t, vs, val, maxlen);
501
snprintf (val, maxlen, "%.2f", vs / 10.0);
505
snprintf (val, maxlen, "%u", vs);
508
canon_search_table_value (entries_settings_1, t, vs, val, maxlen);
512
case MNOTE_CANON_TAG_FOCAL_LENGTH:
513
CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen);
514
vs = exif_get_short (entry->data + t * 2, entry->order);
517
snprintf (val, maxlen, "%u", vs);
521
snprintf (val, maxlen, _("%.2f mm"), vs * 25.4 / 1000);
261
for (j = 0; entries[j].name && ((entries[j].subtag < t) ||
262
((entries[j].subtag == t) && entries[j].value <= vs)); j++)
263
if ((entries[j].subtag == t) && (entries[j].value == vs)) break;
264
if ((entries[j].subtag == t) &&
265
(entries[j].value == vs) && entries[j].name)
266
strncpy (val, entries[j]. name, maxlen - strlen (val));
268
snprintf (buf, sizeof (buf), "0x%04x", vs);
269
strncpy (val, buf, maxlen - strlen (val));
524
canon_search_table_value (entries_focal_length, t, vs, val, maxlen);
278
532
CC (entry->components, n, val, maxlen);
279
533
vs = exif_get_short (entry->data + 2 + t * 2, entry->order);
284
strncpy (val, _("Auto"), maxlen - strlen (val));
287
strncpy (val, _("Sunny"), maxlen - strlen (val));
290
strncpy (val, _("Cloudy"), maxlen - strlen (val));
293
strncpy (val, _("Tungsten"), maxlen - strlen (val));
296
strncpy (val, _("Flourescent"), maxlen - strlen (val));
299
strncpy (val, _("Flash"), maxlen - strlen (val));
302
strncpy (val, _("Custom"), maxlen - strlen (val));
305
snprintf (buf, sizeof (buf), "%i", vs);
306
strncpy (val, buf, maxlen - strlen (val));
537
snprintf (val, maxlen, "%.0f", apex_value_to_iso_speed(vs / 32.0));
543
snprintf (val, maxlen, _("%.2f EV"), vs / 32.0);
547
snprintf (val, maxlen, "%.2f", apex_value_to_aperture (vs / 32.0));
551
d = apex_value_to_shutter_speed(vs / 32.0);
553
snprintf (val, maxlen, _("1/%d"),(int)(1.0 / d));
555
snprintf (val, maxlen, _("%d"), (int) d);
310
snprintf (buf, sizeof (buf), "%u", vs);
311
strncpy (val, buf, maxlen - strlen (val));
316
strncpy (val, _("right"), maxlen - strlen (val));
318
strncpy (val, _("center"), maxlen - strlen (val));
320
strncpy (val, _("left"), maxlen - strlen (val));
322
snprintf (buf, sizeof (buf), _(" (1 available focus point)"));
324
snprintf (buf, sizeof (buf), _(" (%u available focus points)"), vs >> 12);
325
strncat (val, buf, maxlen - strlen (val));
329
snprintf (buf, sizeof (buf), _("%.2f EV"), vs / 32.);
330
strncpy (val, buf, maxlen - strlen (val));
558
snprintf (val, maxlen, "%u", vs);
561
snprintf (val, maxlen, "%.2f", vs / 32.0);
333
snprintf (buf, sizeof (buf), _("%u mm"), vs);
334
strncpy (val, buf, maxlen - strlen (val));
565
snprintf (val, maxlen, _("%u mm"), vs);
569
strncpy(val, _("Off"), maxlen);
572
snprintf (val, maxlen, _("%i (ms)"), vs * 100);
337
snprintf (buf, sizeof (buf), "0x%04x", vs);
338
strncpy (val, buf, maxlen - strlen (val));
575
canon_search_table_value (entries_settings_2, t, vs, val, maxlen);
579
case MNOTE_CANON_TAG_PANORAMA:
580
CF (entry->format, EXIF_FORMAT_SHORT, val, maxlen);
581
vs = exif_get_short (entry->data + t * 2, entry->order);
582
canon_search_table_value (entries_panorama, t, vs, val, maxlen);
343
585
case MNOTE_CANON_TAG_OWNER:
344
586
CC (entry->components, 32, val, maxlen);
345
587
/* Fall through; ImageType can have many sizes */