1 // ***************************************************************** -*- C++ -*-
2 /*
3  * Copyright (C) 2004-2017 Andreas Huggel <ahuggel@gmx.net>
4  *
5  * This program is part of the Exiv2 distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
20  */
21 /*
22   File:      minoltamn.cpp
23   Version:   $Rev: 4746 $
24   Author(s): Gilles Caulier (cgilles) <caulier dot gilles at gmail dot com>
25              Andreas Huggel (ahu) <ahuggel@gmx.net>
26   History:   06-May-06, gc: submitted
27   Credits:   See header file.
28  */
29 
30 // *****************************************************************************
31 #include "rcsid_int.hpp"
32 EXIV2_RCSID("@(#) $Id: minoltamn.cpp 4746 2017-03-23 03:51:21Z nkbj $")
33 
34 // *****************************************************************************
35 // included header files
36 #include "minoltamn_int.hpp"
37 #include "tags_int.hpp"
38 #include "makernote_int.hpp"
39 #include "value.hpp"
40 #include "exif.hpp"
41 #include "i18n.h"                // NLS support.
42 #include "datasets.hpp"
43 
44 #include <string>
45 #include <sstream>
46 #include <iomanip>
47 #include <cassert>
48 #include <cstring>
49 
50 #include <stdio.h> // popen to call exiftool
51 #include <string.h>
52 
53 // *****************************************************************************
54 // class member definitions
55 namespace Exiv2 {
56     namespace Internal {
57 
58     // -- Standard Minolta Makernotes tags ---------------------------------------------------------------
59 
60     //! Lookup table to translate Minolta color mode values to readable labels
61     extern const TagDetails minoltaColorMode[] = {
62         { 0,  N_("Natural Color")  },
63         { 1,  N_("Black & White")  },
64         { 2,  N_("Vivid Color")    },
65         { 3,  N_("Solarization")   },
66         { 4,  N_("AdobeRGB")       },
67         { 5,  N_("Sepia")          },
68         { 9,  N_("Natural")        },
69         { 12, N_("Portrait")       },
70         { 13, N_("Natural sRGB")   },
71         { 14, N_("Natural+ sRGB")  },
72         { 15, N_("Landscape")      },
73         { 16, N_("Evening")        },
74         { 17, N_("Night Scene")    },
75         { 18, N_("Night Portrait") }
76     };
77 
78     //! Lookup table to translate Minolta image quality values to readable labels
79     extern const TagDetails minoltaImageQuality[] = {
80         { 0, N_("Raw")        },
81         { 1, N_("Super Fine") },
82         { 2, N_("Fine")       },
83         { 3, N_("Standard")   },
84         { 4, N_("Economy")    },
85         { 5, N_("Extra Fine") }
86     };
87 
88     //! Lookup table to translate Minolta image stabilization values
89     extern const TagDetails minoltaImageStabilization[] = {
90         { 1, N_("Off") },
91         { 5, N_("On")  }
92     };
93 
94     // Minolta Tag Info
95     const TagInfo MinoltaMakerNote::tagInfo_[] = {
96         TagInfo(0x0000, "Version", N_("Makernote Version"),
97                 N_("String 'MLT0' (not null terminated)"),
98                 minoltaId, makerTags, undefined, -1, printValue),
99         TagInfo(0x0001, "CameraSettingsStdOld", N_("Camera Settings (Std Old)"),
100                 N_("Standard Camera settings (Old Camera models like D5, D7, S304, and S404)"),
101                 minoltaId, makerTags, undefined, -1, printValue),
102         TagInfo(0x0003, "CameraSettingsStdNew", N_("Camera Settings (Std New)"),
103                 N_("Standard Camera settings (New Camera Models like D7u, D7i, and D7hi)"),
104                 minoltaId, makerTags, undefined, -1, printValue),
105         TagInfo(0x0004, "CameraSettings7D", N_("Camera Settings (7D)"),
106                 N_("Camera Settings (for Dynax 7D model)"),
107                 minoltaId, makerTags, undefined, -1, printValue),
108         TagInfo(0x0018, "ImageStabilizationData", N_("Image Stabilization Data"),
109                 N_("Image stabilization data"),
110                 minoltaId, makerTags, undefined, -1, printValue),
111 
112         // TODO: Implement WB Info A100 tags decoding.
113         TagInfo(0x0020, "WBInfoA100", N_("WB Info A100"),
114                 N_("White balance information for the Sony DSLR-A100"),
115                 minoltaId, makerTags, undefined, -1, printValue),
116 
117         TagInfo(0x0040, "CompressedImageSize", N_("Compressed Image Size"),
118                 N_("Compressed image size"),
119                 minoltaId, makerTags, unsignedLong, -1, printValue),
120         TagInfo(0x0081, "Thumbnail", N_("Thumbnail"),
121                 N_("Jpeg thumbnail 640x480 pixels"),
122                 minoltaId, makerTags, undefined, -1, printValue),
123         TagInfo(0x0088, "ThumbnailOffset", N_("Thumbnail Offset"),
124                 N_("Offset of the thumbnail"),
125                 minoltaId, makerTags, unsignedLong, -1, printValue),
126         TagInfo(0x0089, "ThumbnailLength", N_("Thumbnail Length"),
127                 N_("Size of the thumbnail"),
128                 minoltaId, makerTags, unsignedLong, -1, printValue),
129         TagInfo(0x0100, "SceneMode", N_("Scene Mode"),
130                 N_("Scene Mode"),
131                 minoltaId, makerTags, unsignedLong, -1, printMinoltaSonySceneMode),
132 
133         // TODO: for A100, use Sony table from printMinoltaSonyColorMode().
134         TagInfo(0x0101, "ColorMode", N_("Color Mode"),
135                 N_("Color mode"),
136                 minoltaId, makerTags, unsignedLong, -1, EXV_PRINT_TAG(minoltaColorMode)),
137 
138         TagInfo(0x0102, "Quality", N_("Image Quality"),
139                 N_("Image quality"),
140                 minoltaId, makerTags, unsignedLong, -1, printMinoltaSonyImageQuality),
141 
142         // TODO: Tag 0x0103 : quality or image size (see ExifTool doc).
143         TagInfo(0x0103, "0x0103", N_("0x0103"),
144                 N_("0x0103"),
145                 minoltaId, makerTags, unsignedLong, -1, printValue),
146 
147         TagInfo(0x0104, "FlashExposureComp", N_("Flash Exposure Compensation"),
148                 N_("Flash exposure compensation in EV"),
149                 minoltaId, makerTags, signedRational, -1, print0x9204),
150         TagInfo(0x0105, "Teleconverter", N_("Teleconverter Model"),
151                 N_("Teleconverter Model"),
152                 minoltaId, makerTags, unsignedLong, -1, printMinoltaSonyTeleconverterModel),
153         TagInfo(0x0107, "ImageStabilization", N_("Image Stabilization"),
154                 N_("Image stabilization"),
155                 minoltaId, makerTags, unsignedLong, -1, EXV_PRINT_TAG(minoltaImageStabilization)),
156         TagInfo(0x0109, "RawAndJpgRecording", N_("RAW+JPG Recording"),
157                 N_("RAW and JPG files recording"),
158                 minoltaId, makerTags, unsignedLong, -1, printMinoltaSonyBoolValue),
159         TagInfo(0x010a, "ZoneMatching", N_("Zone Matching"),
160                 N_("Zone matching"),
161                 minoltaId, makerTags, unsignedLong, -1, printMinoltaSonyZoneMatching),
162         TagInfo(0x010b, "ColorTemperature", N_("Color Temperature"),
163                 N_("Color temperature"),
164                 minoltaId, makerTags, unsignedLong, -1, printValue),
165         TagInfo(0x010c, "LensID", N_("Lens ID"),
166                 N_("Lens identifier"),
167                 minoltaId, makerTags, unsignedLong, -1, printMinoltaSonyLensID),
168         TagInfo(0x0111, "ColorCompensationFilter", N_("Color Compensation Filter"),
169                 N_("Color Compensation Filter: negative is green, positive is magenta"),
170                 minoltaId, makerTags, unsignedLong, -1, printValue),
171         TagInfo(0x0112, "WhiteBalanceFineTune", N_("White Balance Fine Tune"),
172                 N_("White Balance Fine Tune Value"),
173                 minoltaId, makerTags, unsignedLong, -1, printValue),
174         TagInfo(0x0113, "ImageStabilizationA100", N_("Image Stabilization A100"),
175                 N_("Image Stabilization for the Sony DSLR-A100"),
176                 minoltaId, makerTags, unsignedLong, -1, printMinoltaSonyBoolValue),
177 
178         // TODO: implement CameraSettingsA100 tags decoding.
179         TagInfo(0x0114, "CameraSettings5D", N_("Camera Settings (5D)"),
180                 N_("Camera Settings (for Dynax 5D model)"),
181                 minoltaId, makerTags, undefined, -1, printValue),
182 
183         TagInfo(0x0115, "WhiteBalance", N_("White Balance"),
184                 N_("White balance"),
185                 minoltaId, makerTags, unsignedLong, -1, printMinoltaSonyWhiteBalanceStd),
186         TagInfo(0x0e00, "PrintIM", N_("Print IM"),
187                 N_("PrintIM information"),
188                 minoltaId, makerTags, undefined, -1, printValue),
189         TagInfo(0x0f00, "CameraSettingsZ1", N_("Camera Settings (Z1)"),
190                 N_("Camera Settings (for Z1, DImage X, and F100 models)"),
191                 minoltaId, makerTags, undefined, -1, printValue),
192         // End of list marker
193         TagInfo(0xffff, "(UnknownMinoltaMakerNoteTag)", "(UnknownMinoltaMakerNoteTag)",
194                 N_("Unknown Minolta MakerNote tag"),
195                 minoltaId, makerTags, asciiString, -1, printValue)
196     };
197 
tagList()198     const TagInfo* MinoltaMakerNote::tagList()
199     {
200         return tagInfo_;
201     }
202 
203     // -- Standard Minolta camera settings ---------------------------------------------------------------
204 
205     //! Lookup table to translate Minolta Std camera settings exposure mode values to readable labels
206     extern const TagDetails minoltaExposureModeStd[] = {
207         { 0, N_("Program")           },
208         { 1, N_("Aperture priority") },
209         { 2, N_("Shutter priority")  },
210         { 3, N_("Manual")            }
211     };
212 
213     //! Lookup table to translate Minolta Std camera settings flash mode values to readable labels
214     extern const TagDetails minoltaFlashModeStd[] = {
215         { 0, N_("Fill flash")        },
216         { 1, N_("Red-eye reduction") },
217         { 2, N_("Rear flash sync")   },
218         { 3, N_("Wireless")          },
219         { 4, N_("Off")               }
220     };
221 
222     //! Lookup table to translate Minolta Std camera settings white balance values to readable labels
223     extern const TagDetails minoltaWhiteBalanceStd[] = {
224         { 0,  N_("Auto")          },
225         { 1,  N_("Daylight")      },
226         { 2,  N_("Cloudy")        },
227         { 3,  N_("Tungsten")      },
228         { 5,  N_("Custom")        },
229         { 7,  N_("Fluorescent")   },
230         { 8,  N_("Fluorescent 2") },
231         { 11, N_("Custom 2")      },
232         { 12, N_("Custom 3")      }
233     };
234 
235     //! Lookup table to translate Minolta Std camera settings image size values to readable labels
236     extern const TagDetails minoltaImageSizeStd[] = {
237         { 0, N_("Full size") },
238         { 1, "1600x1200"     },
239         { 2, "1280x960"      },
240         { 3, "640x480"       },
241         { 6, "2080x1560"     },
242         { 7, "2560x1920"     },
243         { 8, "3264x2176"     }
244     };
245 
246     //! Lookup table to translate Minolta Std camera settings image quality values to readable labels
247     extern const TagDetails minoltaImageQualityStd[] = {
248         { 0, N_("Raw")        },
249         { 1, N_("Super fine") },
250         { 2, N_("Fine")       },
251         { 3, N_("Standard")   },
252         { 4, N_("Economy")    },
253         { 5, N_("Extra fine") }
254     };
255 
256     //! Lookup table to translate Minolta Std camera settings drive mode values to readable labels
257     extern const TagDetails minoltaDriveModeStd[] = {
258         { 0, N_("Single Frame")   },
259         { 1, N_("Continuous")     },
260         { 2, N_("Self-timer")     },
261         { 4, N_("Bracketing")     },
262         { 5, N_("Interval")       },
263         { 6, N_("UHS continuous") },
264         { 7, N_("HS continuous")  }
265     };
266 
267     //! Lookup table to translate Minolta Std camera settings metering mode values to readable labels
268     extern const TagDetails minoltaMeteringModeStd[] = {
269         { 0, N_("Multi-segment")           },
270         { 1, N_("Center weighted average") },
271         { 2, N_("Spot")                    }
272     };
273 
274     //! Lookup table to translate Minolta Std camera settings digital zoom values to readable labels
275     extern const TagDetails minoltaDigitalZoomStd[] = {
276         { 0, N_("Off")                      },
277         { 1, N_("Electronic magnification") },
278         { 2, "2x"                           }
279     };
280 
281     //! Lookup table to translate Minolta Std camera bracket step mode values to readable labels
282     extern const TagDetails minoltaBracketStepStd[] = {
283         { 0, "1/3 EV" },
284         { 1, "2/3 EV" },
285         { 2, "1 EV"   }
286     };
287 
288     //! Lookup table to translate Minolta Std camera settings AF points values to readable labels
289     extern const TagDetails minoltaAFPointsStd[] = {
290         { 0, N_("Center")       },
291         { 1, N_("Top")          },
292         { 2, N_("Top-right")    },
293         { 3, N_("Right")        },
294         { 4, N_("Bottom-right") },
295         { 5, N_("Bottom")       },
296         { 6, N_("Bottom-left")  },
297         { 7, N_("Left")         },
298         { 8, N_("Top-left")     }
299     };
300 
301     //! Lookup table to translate Minolta Std camera settings flash fired values to readable labels
302     extern const TagDetails minoltaFlashFired[] = {
303         { 0, N_("Did not fire") },
304         { 1, N_("Fired")        }
305     };
306 
307     //! Lookup table to translate Minolta Std camera settings sharpness values to readable labels
308     extern const TagDetails minoltaSharpnessStd[] = {
309         { 0, N_("Hard")   },
310         { 1, N_("Normal") },
311         { 2, N_("Soft")   }
312     };
313 
314     //! Lookup table to translate Minolta Std camera settings subject program values to readable labels
315     extern const TagDetails minoltaSubjectProgramStd[] = {
316         { 0, N_("None")           },
317         { 1, N_("Portrait")       },
318         { 2, N_("Text")           },
319         { 3, N_("Night portrait") },
320         { 4, N_("Sunset")         },
321         { 5, N_("Sports action")  }
322     };
323 
324     //! Lookup table to translate Minolta Std camera settings ISO settings values to readable labels
325     extern const TagDetails minoltaISOSettingStd[] = {
326         { 0, "100"      },
327         { 1, "200"      },
328         { 2, "400"      },
329         { 3, "800"      },
330         { 4, N_("Auto") },
331         { 5, "64"       }
332     };
333 
334     //! Lookup table to translate Minolta Std camera settings model values to readable labels
335     extern const TagDetails minoltaModelStd[] = {
336         { 0, "DiMAGE 7 | X1 | X21 | X31" },
337         { 1, "DiMAGE 5"                  },
338         { 2, "DiMAGE S304"               },
339         { 3, "DiMAGE S404"               },
340         { 4, "DiMAGE 7i"                 },
341         { 5, "DiMAGE 7Hi"                },
342         { 6, "DiMAGE A1"                 },
343         { 7, "DiMAGE A2 | S414"          },
344         { 7, "DiMAGE A2 | S414"          }      // To silence compiler warning
345     };
346 
347     //! Lookup table to translate Minolta Std camera settings interval mode values to readable labels
348     extern const TagDetails minoltaIntervalModeStd[] = {
349         { 0, N_("Still image")      },
350         { 1, N_("Time-lapse movie") }
351     };
352 
353     //! Lookup table to translate Minolta Std camera settings folder name values to readable labels
354     extern const TagDetails minoltaFolderNameStd[] = {
355         { 0, N_("Standard form") },
356         { 1, N_("Data form")     }
357     };
358 
359     //! Lookup table to translate Minolta Std camera settings color mode values to readable labels
360     extern const TagDetails minoltaColorModeStd[] = {
361         { 0, N_("Natural color")   },
362         { 1, N_("Black and white") },
363         { 2, N_("Vivid color")     },
364         { 3, N_("Solarization")    },
365         { 4, N_("Adobe RGB")       }
366     };
367 
368     //! Lookup table to translate Minolta Std camera settings wide focus zone values to readable labels
369     extern const TagDetails minoltaWideFocusZoneStd[] = {
370         { 0, N_("No zone")                              },
371         { 1, N_("Center zone (horizontal orientation)") },
372         { 1, N_("Center zone (vertical orientation)")   },
373         { 1, N_("Left zone")                            },
374         { 4, N_("Right zone")                           }
375     };
376 
377     //! Lookup table to translate Minolta Std camera settings focus mode values to readable labels
378     extern const TagDetails minoltaFocusModeStd[] = {
379         { 0, N_("Auto focus")   },
380         { 1, N_("Manual focus") }
381     };
382 
383     //! Lookup table to translate Minolta Std camera settings focus area values to readable labels
384     extern const TagDetails minoltaFocusAreaStd[] = {
385         { 0, N_("Wide focus (normal)") },
386         { 1, N_("Spot focus")          }
387     };
388 
389     //! Lookup table to translate Minolta Std camera settings DEC switch position values to readable labels
390     extern const TagDetails minoltaDECPositionStd[] = {
391         { 0, N_("Exposure")   },
392         { 1, N_("Contrast")   },
393         { 2, N_("Saturation") },
394         { 3, N_("Filter")     }
395     };
396 
397     //! Lookup table to translate Minolta Std camera settings color profile values to readable labels
398     extern const TagDetails minoltaColorProfileStd[] = {
399         { 0, N_("Not embedded") },
400         { 1, N_("Embedded")     }
401     };
402 
403     //! Lookup table to translate Minolta Std camera settings data Imprint values to readable labels
404     extern const TagDetails minoltaDataImprintStd[] = {
405         { 0, N_("None")       },
406         { 1, "YYYY/MM/DD"     },
407         { 2, "MM/DD/HH:MM"    },
408         { 3, N_("Text")       },
409         { 4, N_("Text + ID#") }
410     };
411 
412     //! Lookup table to translate Minolta Std camera settings flash metering values to readable labels
413     extern const TagDetails minoltaFlashMeteringStd[] = {
414         { 0, N_("ADI (Advanced Distance Integration)") },
415         { 1, N_("Pre-flash TTl")                       },
416         { 2, N_("Manual flash control")                }
417     };
418 
printMinoltaExposureSpeedStd(std::ostream & os,const Value & value,const ExifData *)419     std::ostream& MinoltaMakerNote::printMinoltaExposureSpeedStd(std::ostream& os, const Value& value, const ExifData*)
420     {
421         // From the PHP JPEG Metadata Toolkit
422         os << (value.toLong()/8)-1;
423         return os;
424     }
425 
printMinoltaExposureTimeStd(std::ostream & os,const Value & value,const ExifData *)426     std::ostream& MinoltaMakerNote::printMinoltaExposureTimeStd(std::ostream& os, const Value& value, const ExifData*)
427     {
428         // From the PHP JPEG Metadata Toolkit
429         os << (value.toLong()/8)-6;
430         return os;
431     }
432 
printMinoltaFNumberStd(std::ostream & os,const Value & value,const ExifData *)433     std::ostream& MinoltaMakerNote::printMinoltaFNumberStd(std::ostream& os, const Value& value, const ExifData*)
434     {
435         // From the PHP JPEG Metadata Toolkit
436         os << (value.toLong()/8)-1;
437         return os;
438     }
439 
printMinoltaExposureCompensationStd(std::ostream & os,const Value & value,const ExifData *)440     std::ostream& MinoltaMakerNote::printMinoltaExposureCompensationStd(std::ostream& os, const Value& value, const ExifData*)
441     {
442         // From the PHP JPEG Metadata Toolkit
443         os << value.toLong()/256;
444         return os;
445     }
446 
printMinoltaFocalLengthStd(std::ostream & os,const Value & value,const ExifData *)447     std::ostream& MinoltaMakerNote::printMinoltaFocalLengthStd(std::ostream& os, const Value& value, const ExifData*)
448     {
449         // From the PHP JPEG Metadata Toolkit
450         os << (value.toLong()/3)-2;
451         return os;
452     }
453 
printMinoltaDateStd(std::ostream & os,const Value & value,const ExifData *)454     std::ostream& MinoltaMakerNote::printMinoltaDateStd(std::ostream& os, const Value& value, const ExifData*)
455     {
456         // From the PHP JPEG Metadata Toolkit
457         os << value.toLong() / 65536 << ":" << std::right << std::setw(2) << std::setfill('0')
458            << (value.toLong() - value.toLong() / 65536 * 65536) / 256 << ":"
459            << std::right << std::setw(2) << std::setfill('0') << value.toLong() % 256;
460         return os;
461     }
462 
printMinoltaTimeStd(std::ostream & os,const Value & value,const ExifData *)463     std::ostream& MinoltaMakerNote::printMinoltaTimeStd(std::ostream& os, const Value& value, const ExifData*)
464     {
465         // From the PHP JPEG Metadata Toolkit
466         os << std::right << std::setw(2) << std::setfill('0') << value.toLong() / 65536
467            << ":" << std::right << std::setw(2) << std::setfill('0')
468            << (value.toLong() - value.toLong() / 65536 * 65536) / 256 << ":"
469            << std::right << std::setw(2) << std::setfill('0') << value.toLong() % 256;
470         return os;
471     }
472 
printMinoltaFlashExposureCompStd(std::ostream & os,const Value & value,const ExifData *)473     std::ostream& MinoltaMakerNote::printMinoltaFlashExposureCompStd(std::ostream& os, const Value& value, const ExifData*)
474     {
475         // From the PHP JPEG Metadata Toolkit
476         os << (value.toLong()-6)/3;
477         return os;
478     }
479 
printMinoltaWhiteBalanceStd(std::ostream & os,const Value & value,const ExifData *)480     std::ostream& MinoltaMakerNote::printMinoltaWhiteBalanceStd(std::ostream& os, const Value& value, const ExifData*)
481     {
482         // From the PHP JPEG Metadata Toolkit
483         os << value.toLong()/256;
484         return os;
485     }
486 
printMinoltaBrightnessStd(std::ostream & os,const Value & value,const ExifData *)487     std::ostream& MinoltaMakerNote::printMinoltaBrightnessStd(std::ostream& os, const Value& value, const ExifData*)
488     {
489         // From the PHP JPEG Metadata Toolkit
490         os << (value.toLong()/8)-6;
491         return os;
492     }
493 
494     // Minolta Standard Camera Settings Tag Info (Old and New)
495     const TagInfo MinoltaMakerNote::tagInfoCsStd_[] = {
496         TagInfo(0x0001, "ExposureMode", N_("Exposure Mode"),
497                 N_("Exposure mode"),
498                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaExposureModeStd)),
499         TagInfo(0x0002, "FlashMode", N_("Flash Mode"),
500                 N_("Flash mode"),
501                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaFlashModeStd)),
502         TagInfo(0x0003, "WhiteBalance", N_("White Balance"),
503                 N_("White balance"),
504                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaWhiteBalanceStd)),
505         TagInfo(0x0004, "ImageSize", N_("Image Size"),
506                 N_("Image size"),
507                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaImageSizeStd)),
508         TagInfo(0x0005, "Quality", N_("Image Quality"),
509                 N_("Image quality"),
510                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaImageQualityStd)),
511         TagInfo(0x0006, "DriveMode", N_("Drive Mode"),
512                 N_("Drive mode"),
513                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaDriveModeStd)),
514         TagInfo(0x0007, "MeteringMode", N_("Metering Mode"),
515                 N_("Metering mode"),
516                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaMeteringModeStd)),
517         TagInfo(0x0008, "ISO", N_("ISO"),
518                 N_("ISO Value"),
519                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaExposureSpeedStd),
520         TagInfo(0x0009, "ExposureTime", N_("Exposure Time"),
521                 N_("Exposure time"),
522                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaExposureTimeStd),
523         TagInfo(0x000A, "FNumber", N_("FNumber"),
524                 N_("The F-Number"),
525                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaFNumberStd),
526         TagInfo(0x000B, "MacroMode", N_("Macro Mode"),
527                 N_("Macro mode"),
528                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaSonyBoolValue),
529         TagInfo(0x000C, "DigitalZoom", N_("Digital Zoom"),
530                 N_("Digital zoom"),
531                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaDigitalZoomStd)),
532         TagInfo(0x000D, "ExposureCompensation", N_("Exposure Compensation"),
533                 N_("Exposure compensation"),
534                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaExposureCompensationStd),
535         TagInfo(0x000E, "BracketStep", N_("Bracket Step"),
536                 N_("Bracket step"),
537                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaBracketStepStd)),
538         TagInfo(0x0010, "IntervalLength", N_("Interval Length"),
539                 N_("Interval length"),
540                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
541         TagInfo(0x0011, "IntervalNumber", N_("Interval Number"),
542                 N_("Interval number"),
543                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
544         TagInfo(0x0012, "FocalLength", N_("Focal Length"),
545                 N_("Focal length"),
546                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaFocalLengthStd),
547         TagInfo(0x0013, "FocusDistance", N_("Focus Distance"),
548                 N_("Focus distance"),
549                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
550         TagInfo(0x0014, "FlashFired", N_("Flash Fired"),
551                 N_("Flash fired"),
552                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaFlashFired)),
553         TagInfo(0x0015, "MinoltaDate", N_("Minolta Date"),
554                 N_("Minolta date"),
555                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaDateStd),
556         TagInfo(0x0016, "MinoltaTime", N_("Minolta Time"),
557                 N_("Minolta time"),
558                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaTimeStd),
559         TagInfo(0x0017, "MaxAperture", N_("Max Aperture"),
560                 N_("Max aperture"),
561                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
562         TagInfo(0x001A, "FileNumberMemory", N_("File Number Memory"),
563                 N_("File number memory"),
564                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaSonyBoolValue),
565         TagInfo(0x001B, "LastFileNumber", N_("Last Image Number"),
566                 N_("Last image number"),
567                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
568         TagInfo(0x001C, "ColorBalanceRed", N_("Color Balance Red"),
569                 N_("Color balance red"),
570                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaWhiteBalanceStd),
571         TagInfo(0x001D, "ColorBalanceGreen", N_("Color Balance Green"),
572                 N_("Color balance green"),
573                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaWhiteBalanceStd),
574         TagInfo(0x001E, "ColorBalanceBlue", N_("Color Balance Blue"),
575                 N_("Color balance blue"),
576                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaWhiteBalanceStd),
577         TagInfo(0x001F, "Saturation", N_("Saturation"),
578                 N_("Saturation"),
579                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
580         TagInfo(0x0020, "Contrast", N_("Contrast"),
581                 N_("Contrast"),
582                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
583         TagInfo(0x0021, "Sharpness", N_("Sharpness"),
584                 N_("Sharpness"),
585                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaSharpnessStd)),
586         TagInfo(0x0022, "SubjectProgram", N_("Subject Program"),
587                 N_("Subject program"),
588                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaSubjectProgramStd)),
589         TagInfo(0x0023, "FlashExposureComp", N_("Flash Exposure Compensation"),
590                 N_("Flash exposure compensation in EV"),
591                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaFlashExposureCompStd),
592         TagInfo(0x0024, "ISOSetting", N_("ISO Settings"),
593                 N_("ISO setting"),
594                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaISOSettingStd)),
595         TagInfo(0x0025, "MinoltaModel", N_("Minolta Model"),
596                 N_("Minolta model"),
597                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaModelStd)),
598         TagInfo(0x0026, "IntervalMode", N_("Interval Mode"),
599                 N_("Interval mode"),
600                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaIntervalModeStd)),
601         TagInfo(0x0027, "FolderName", N_("Folder Name"),
602                 N_("Folder name"),
603                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaFolderNameStd)),
604         TagInfo(0x0028, "ColorMode", N_("ColorMode"),
605                 N_("ColorMode"),
606                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaColorModeStd)),
607         TagInfo(0x0029, "ColorFilter", N_("Color Filter"),
608                 N_("Color filter"),
609                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
610         TagInfo(0x002A, "BWFilter", N_("Black and White Filter"),
611                 N_("Black and white filter"),
612                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
613         TagInfo(0x002B, "Internal Flash", N_("Internal Flash"),
614                 N_("Internal Flash"),
615                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaFlashFired)),
616         TagInfo(0x002C, "Brightness", N_("Brightness"),
617                 N_("Brightness"),
618                 minoltaCsNewId, makerTags, unsignedLong, 1, printMinoltaBrightnessStd),
619         TagInfo(0x002D, "SpotFocusPointX", N_("Spot Focus Point X"),
620                 N_("Spot focus point X"),
621                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
622         TagInfo(0x002E, "SpotFocusPointY", N_("Spot Focus Point Y"),
623                 N_("Spot focus point Y"),
624                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue),
625         TagInfo(0x002F, "WideFocusZone", N_("Wide Focus Zone"),
626                 N_("Wide focus zone"),
627                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaWideFocusZoneStd)),
628         TagInfo(0x0030, "FocusMode", N_("Focus Mode"),
629                 N_("Focus mode"),
630                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaFocusModeStd)),
631         TagInfo(0x0031, "FocusArea", N_("Focus area"),
632                 N_("Focus area"),
633                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaFocusAreaStd)),
634         TagInfo(0x0032, "DECPosition", N_("DEC Switch Position"),
635                 N_("DEC switch position"),
636                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaDECPositionStd)),
637         TagInfo(0x0033, "ColorProfile", N_("Color Profile"),
638                 N_("Color profile"),
639                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaColorProfileStd)),
640         TagInfo(0x0034, "DataImprint", N_("Data Imprint"),
641                 N_("Data Imprint"),
642                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaDataImprintStd)),
643         TagInfo(0x003F, "FlashMetering", N_("Flash Metering"),
644                 N_("Flash metering"),
645                 minoltaCsNewId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaFlashMeteringStd)),
646         // End of list marker
647         TagInfo(0xffff, "(UnknownMinoltaCsStdTag)", "(UnknownMinoltaCsStdTag)",
648                 N_("Unknown Minolta Camera Settings tag"),
649                 minoltaCsNewId, makerTags, unsignedLong, 1, printValue)
650     };
651 
tagListCsStd()652     const TagInfo* MinoltaMakerNote::tagListCsStd()
653     {
654         return tagInfoCsStd_;
655     }
656 
657     // -- Minolta Dynax 7D camera settings ---------------------------------------------------------------
658 
659     //! Lookup table to translate Minolta Dynax 7D camera settings exposure mode values to readable labels
660     extern const TagDetails minoltaExposureMode7D[] = {
661         { 0, N_("Program")           },
662         { 1, N_("Aperture priority") },
663         { 2, N_("Shutter priority")  },
664         { 3, N_("Manual")            },
665         { 4, N_("Auto")              },
666         { 5, N_("Program-shift A")   },
667         { 6, N_("Program-shift S")   }
668     };
669 
670     //! Lookup table to translate Minolta Dynax 7D camera settings image size values to readable labels
671     extern const TagDetails minoltaImageSize7D[] = {
672         { 0, N_("Large")  },
673         { 1, N_("Medium") },
674         { 2, N_("Small")  }
675     };
676 
677     //! Lookup table to translate Minolta Dynax 7D camera settings image quality values to readable labels
678     extern const TagDetails minoltaImageQuality7D[] = {
679         { 0,  N_("Raw")      },
680         { 16, N_("Fine")     },
681         { 32, N_("Normal")   },
682         { 34, N_("Raw+Jpeg") },
683         { 48, N_("Economy")  }
684     };
685 
686     //! Lookup table to translate Minolta Dynax 7D camera settings white balance values to readable labels
687     extern const TagDetails minoltaWhiteBalance7D[] = {
688         { 0,   N_("Auto")        },
689         { 1,   N_("Daylight")    },
690         { 2,   N_("Shade")       },
691         { 3,   N_("Cloudy")      },
692         { 4,   N_("Tungsten")    },
693         { 5,   N_("Fluorescent") },
694         { 256, N_("Kelvin")      },
695         { 512, N_("Manual")      },
696         { 512, N_("Manual")      }              // To silence compiler warning
697     };
698 
699     //! Lookup table to translate Minolta Dynax 7D camera settings focus mode values to readable labels
700     extern const TagDetails minoltaFocusMode7D[] = {
701         { 0, N_("Single-shot AF") },
702         { 1, N_("Continuous AF")  },
703         { 3, N_("Manual")         },
704         { 4, N_("Automatic AF")   }
705     };
706 
707     //! Lookup table to translate Minolta Dynax 7D camera settings AF points values to readable labels
708     extern const TagDetails minoltaAFPoints7D[] = {
709         { 1,   N_("Center")       },
710         { 2,   N_("Top")          },
711         { 4,   N_("Top-right")    },
712         { 8,   N_("Right")        },
713         { 16,  N_("Bottom-right") },
714         { 32,  N_("Bottom")       },
715         { 64,  N_("Bottom-left")  },
716         { 128, N_("Left")         },
717         { 256, N_("Top-left")     }
718     };
719 
720     //! Lookup table to translate Minolta Dynax 7D camera settings ISO settings values to readable labels
721     extern const TagDetails minoltaISOSetting7D[] = {
722         { 0, N_("Auto") },
723         { 1, "100"      },
724         { 3, "200"      },
725         { 4, "400"      },
726         { 5, "800"      },
727         { 6, "1600"     },
728         { 7, "3200"     }
729     };
730 
731     //! Lookup table to translate Minolta Dynax 7D camera settings color space values to readable labels
732     extern const TagDetails minoltaColorSpace7D[] = {
733         { 0, N_("sRGB (Natural)")  },
734         { 1, N_("sRGB (Natural+)") },
735         { 4, N_("Adobe RGB")       }
736     };
737 
738     //! Lookup table to translate Minolta Dynax 7D camera settings rotation values to readable labels
739     extern const TagDetails minoltaRotation7D[] = {
740         { 72, N_("Horizontal (normal)") },
741         { 76, N_("Rotate 90 CW")        },
742         { 82, N_("Rotate 270 CW")       }
743     };
744 
745     // Minolta Dynax 7D Camera Settings Tag Info
746     const TagInfo MinoltaMakerNote::tagInfoCs7D_[] = {
747         TagInfo(0x0000, "ExposureMode", N_("Exposure Mode"),
748                 N_("Exposure mode"),
749                 minoltaCs7DId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaExposureMode7D)),
750         TagInfo(0x0002, "ImageSize", N_("Image Size"),
751                 N_("Image size"),
752                 minoltaCs7DId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaImageSize7D)),
753         TagInfo(0x0003, "Quality", N_("Image Quality"),
754                 N_("Image quality"),
755                 minoltaCs7DId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaImageQuality7D)),
756         TagInfo(0x0004, "WhiteBalance", N_("White Balance"),
757                 N_("White balance"),
758                 minoltaCs7DId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaWhiteBalance7D)),
759         TagInfo(0x000E, "FocusMode", N_("Focus Mode"),
760                 N_("Focus mode"),
761                 minoltaCs7DId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaFocusMode7D)),
762         TagInfo(0x0010, "AFPoints", N_("AF Points"),
763                 N_("AF points"),
764                 minoltaCs7DId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaAFPoints7D)),
765         TagInfo(0x0015, "FlashFired", N_("Flash Fired"),
766                 N_("Flash fired"),
767                 minoltaCs7DId, makerTags, unsignedLong, 1, EXV_PRINT_TAG(minoltaFlashFired)),
768         TagInfo(0x0016, "FlashMode", N_("Flash Mode"),
769                 N_("Flash mode"),
770                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
771         TagInfo(0x001C, "ISOSpeed", N_("ISO Speed Mode"),
772                 N_("ISO speed setting"),
773                 minoltaCs7DId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaISOSetting7D)),
774         TagInfo(0x001E, "ExposureCompensation", N_("Exposure Compensation"),
775                 N_("Exposure compensation"),
776                 minoltaCs7DId, makerTags, signedShort, 1, printValue),
777         TagInfo(0x0025, "ColorSpace", N_("Color Space"),
778                 N_("Color space"),
779                 minoltaCs7DId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaColorSpace7D)),
780         TagInfo(0x0026, "Sharpness", N_("Sharpness"),
781                 N_("Sharpness"),
782                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
783         TagInfo(0x0027, "Contrast", N_("Contrast"),
784                 N_("Contrast"),
785                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
786         TagInfo(0x0028, "Saturation", N_("Saturation"),
787                 N_("Saturation"),
788                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
789         TagInfo(0x002D, "FreeMemoryCardImages", N_("Free Memory Card Images"),
790                 N_("Free memory card images"),
791                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
792         TagInfo(0x003F, "ColorTemperature", N_("Color Temperature"),
793                 N_("Color temperature"),
794                 minoltaCs7DId, makerTags, signedShort, 1, printValue),
795         TagInfo(0x0040, "Hue", N_("Hue"), N_("Hue"),
796                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
797         TagInfo(0x0046, "Rotation", N_("Rotation"),
798                 N_("Rotation"),
799                 minoltaCs7DId, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaRotation7D)),
800         TagInfo(0x0047, "FNumber", N_("FNumber"),
801                 N_("The F-Number"),
802                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
803         TagInfo(0x0048, "ExposureTime", N_("Exposure Time"),
804                 N_("Exposure time"),
805                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
806         // 0x004A is a dupplicate than 0x002D.
807         TagInfo(0x004A, "FreeMemoryCardImages", N_("Free Memory Card Images"),
808                 N_("Free memory card images"),
809                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
810         TagInfo(0x005E, "ImageNumber", N_("Image Number"),
811                 N_("Image number"),
812                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
813         TagInfo(0x0060, "NoiseReduction", N_("Noise Reduction"),
814                 N_("Noise reduction"),
815                 minoltaCs7DId, makerTags, unsignedShort, 1, printMinoltaSonyBoolValue),
816         // 0x0062 is a dupplicate than 0x005E.
817         TagInfo(0x0062, "ImageNumber", N_("Image Number"),
818                 N_("Image number"),
819                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue),
820         TagInfo(0x0071, "ImageStabilization", N_("Image Stabilization"),
821                 N_("Image stabilization"),
822                 minoltaCs7DId, makerTags, unsignedShort, 1, printMinoltaSonyBoolValue),
823         TagInfo(0x0075, "ZoneMatchingOn", N_("Zone Matching On"),
824                 N_("Zone matching on"),
825                 minoltaCs7DId, makerTags, unsignedShort, 1, printMinoltaSonyBoolValue),
826         // End of list marker
827         TagInfo(0xffff, "(UnknownMinoltaCs7DTag)", "(UnknownMinoltaCs7DTag)",
828                 N_("Unknown Minolta Camera Settings 7D tag"),
829                 minoltaCs7DId, makerTags, unsignedShort, 1, printValue)
830     };
831 
tagListCs7D()832     const TagInfo* MinoltaMakerNote::tagListCs7D()
833     {
834         return tagInfoCs7D_;
835     }
836 
837     // -- Minolta Dynax 5D camera settings ---------------------------------------------------------------
838 
839     //! Lookup table to translate Minolta Dynax 5D camera settings exposure mode values to readable labels
840     extern const TagDetails minoltaExposureMode5D[] = {
841         { 0,      N_("Program")             },
842         { 1,      N_("Aperture priority")   },
843         { 2,      N_("Shutter priority")    },
844         { 3,      N_("Manual")              },
845         { 4,      N_("Auto")                },
846         { 5,      N_("Program Shift A")     },
847         { 6,      N_("Program Shift S")     },
848         { 0x1013, N_("Portrait")            },
849         { 0x1023, N_("Sports")              },
850         { 0x1033, N_("Sunset")              },
851         { 0x1043, N_("Night View/Portrait") },
852         { 0x1053, N_("Landscape")           },
853         { 0x1083, N_("Macro")               }
854     };
855 
856     //! Lookup table to translate Minolta Dynax 5D camera settings image size values to readable labels
857     extern const TagDetails minoltaImageSize5D[] = {
858         { 0, N_("Large")  },
859         { 1, N_("Medium") },
860         { 2, N_("Small")  }
861     };
862 
863     //! Lookup table to translate Minolta Dynax 5D camera settings image quality values to readable labels
864     extern const TagDetails minoltaImageQuality5D[] = {
865         { 0,  N_("Raw")      },
866         { 16, N_("Fine")     },
867         { 32, N_("Normal")   },
868         { 34, N_("Raw+Jpeg") },
869         { 48, N_("Economy")  }
870     };
871 
872     //! Lookup table to translate Minolta Dynax 5D camera settings white balance values to readable labels
873     extern const TagDetails minoltaWhiteBalance5D[] = {
874         { 0,   N_("Auto")        },
875         { 1,   N_("Daylight")    },
876         { 2,   N_("Cloudy")      },
877         { 3,   N_("Shade")       },
878         { 4,   N_("Tungsten")    },
879         { 5,   N_("Fluorescent") },
880         { 6,   N_("Flash")       },
881         { 256, N_("Kelvin")      },
882         { 512, N_("Manual")      }
883     };
884 
885     //! Lookup table to translate Minolta Dynax 5D camera settings metering mode values to readable labels
886     extern const TagDetails minoltaMeteringMode5D[] = {
887         { 0, N_("Multi-segment")   },
888         { 1, N_("Center weighted") },
889         { 2, N_("Spot")            }
890     };
891 
892     //! Lookup table to translate Minolta Dynax 5D camera settings ISO settings values to readable labels
893     extern const TagDetails minoltaISOSetting5D[] = {
894         { 0,  N_("Auto")                     },
895         { 1,  "100"                          },
896         { 3,  "200"                          },
897         { 4,  "400"                          },
898         { 5,  "800"                          },
899         { 6,  "1600"                         },
900         { 7,  "3200"                         },
901         { 8,  N_("200 (Zone Matching High)") },
902         { 10, N_("80 (Zone Matching Low)")   }
903     };
904 
905     //! Lookup table to translate Minolta Dynax 5D camera settings color space values to readable labels
906     extern const TagDetails minoltaColorSpace5D[] = {
907         { 0, N_("sRGB (Natural)")  },
908         { 1, N_("sRGB (Natural+)") },
909         { 2, N_("Monochrome")      },
910         { 3, N_("Adobe RGB (ICC)") },
911         { 4, N_("Adobe RGB")       }
912     };
913 
914     //! Lookup table to translate Minolta Dynax 5D camera settings rotation values to readable labels
915     extern const TagDetails minoltaRotation5D[] = {
916         { 72, N_("Horizontal (normal)") },
917         { 76, N_("Rotate 90 CW")        },
918         { 82, N_("Rotate 270 CW")       }
919     };
920 
921     //! Lookup table to translate Minolta Dynax 5D camera settings focus position values to readable labels
922     extern const TagDetails minoltaFocusPosition5D[] = {
923         { 0, N_("Wide")       },
924         { 1, N_("Central")    },
925         { 2, N_("Up")         },
926         { 3, N_("Up right")   },
927         { 4, N_("Right")      },
928         { 5, N_("Down right") },
929         { 6, N_("Down")       },
930         { 7, N_("Down left")  },
931         { 8, N_("Left")       },
932         { 9, N_("Up left")    }
933     };
934 
935     //! Lookup table to translate Minolta Dynax 5D camera settings focus area values to readable labels
936     extern const TagDetails minoltaFocusArea5D[] = {
937         { 0, N_("Wide")      },
938         { 1, N_("Selection") },
939         { 2, N_("Spot")      }
940     };
941 
942     //! Lookup table to translate Minolta Dynax 5D camera settings focus mode values to readable labels
943     extern const TagDetails minoltaAFMode5D[] = {
944         { 0, "AF-A" },
945         { 1, "AF-S" },
946         { 2, "AF-D" },
947         { 3, "DMF"  }
948     };
949 
950     //! Lookup table to translate Minolta Dynax 5D camera settings picture finish values to readable labels
951     extern const TagDetails minoltaPictureFinish5D[] = {
952         { 0, N_("Natural")         },
953         { 1, N_("Natural+")        },
954         { 2, N_("Portrait")        },
955         { 3, N_("Wind Scene")      },
956         { 4, N_("Evening Scene")   },
957         { 5, N_("Night Scene")     },
958         { 6, N_("Night Portrait")  },
959         { 7, N_("Monochrome")      },
960         { 8, N_("Adobe RGB")       },
961         { 9, N_("Adobe RGB (ICC)") }
962     };
963 
964     //! Method to convert Minolta Dynax 5D exposure manual bias values.
printMinoltaExposureManualBias5D(std::ostream & os,const Value & value,const ExifData *)965     std::ostream& MinoltaMakerNote::printMinoltaExposureManualBias5D(std::ostream& os, const Value& value, const ExifData*)
966     {
967         // From Xavier Raynaud: the value is converted from 0:256 to -5.33:5.33
968 
969         std::ios::fmtflags f( os.flags() );
970         std::ostringstream oss;
971         oss.copyfmt(os);
972         os << std::fixed << std::setprecision(2)
973            << (float (value.toLong()-128)/24);
974         os.copyfmt(oss);
975         os.flags(f);
976         return os;
977     }
978 
979     //! Method to convert Minolta Dynax 5D exposure compensation values.
printMinoltaExposureCompensation5D(std::ostream & os,const Value & value,const ExifData *)980     std::ostream& MinoltaMakerNote::printMinoltaExposureCompensation5D(std::ostream& os, const Value& value, const ExifData*)
981     {
982         std::ios::fmtflags f( os.flags() );
983         std::ostringstream oss;
984         oss.copyfmt(os);
985         os << std::fixed << std::setprecision(2)
986            << (float (value.toLong()-300)/100);
987         os.copyfmt(oss);
988         os.flags(f);
989         return os;
990     }
991 
992     // Minolta Dynax 5D Camera Settings Tag Info
993     const TagInfo MinoltaMakerNote::tagInfoCs5D_[] = {
994         TagInfo(0x000A, "ExposureMode", N_("Exposure Mode"),
995                 N_("Exposure mode"),
996                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaExposureMode5D)),
997         TagInfo(0x000C, "ImageSize", N_("Image Size"),
998                 N_("Image size"),
999                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaImageSize5D)),
1000         TagInfo(0x000D, "Quality", N_("Image Quality"),
1001                 N_("Image quality"),
1002                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaImageQuality5D)),
1003         TagInfo(0x000E, "WhiteBalance", N_("White Balance"),
1004                 N_("White balance"),
1005                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaWhiteBalance5D)),
1006         TagInfo(0x001A, "FocusPosition", N_("Focus Position"),
1007                 N_("Focus position"),
1008                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaFocusPosition5D)),
1009         TagInfo(0x001B, "FocusArea", N_("Focus Area"),
1010                 N_("Focus area"),
1011                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaFocusArea5D)),
1012         TagInfo(0x001F, "FlashFired", N_("Flash Fired"),
1013                 N_("Flash fired"),
1014                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaFlashFired)),
1015         TagInfo(0x0025, "MeteringMode", N_("Metering Mode"),
1016                 N_("Metering mode"),
1017                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaMeteringMode5D)),
1018         TagInfo(0x0026, "ISOSpeed", N_("ISO Speed Mode"),
1019                 N_("ISO speed setting"),
1020                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaISOSetting5D)),
1021         TagInfo(0x002F, "ColorSpace", N_("Color Space"),
1022                 N_("Color space"),
1023                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaColorSpace5D)),
1024         TagInfo(0x0030, "Sharpness", N_("Sharpness"),
1025                 N_("Sharpness"),
1026                 minoltaCs5DId, makerTags, unsignedShort, -1, printValue),
1027         TagInfo(0x0031, "Contrast", N_("Contrast"),
1028                 N_("Contrast"),
1029                 minoltaCs5DId, makerTags, unsignedShort, -1, printValue),
1030         TagInfo(0x0032, "Saturation", N_("Saturation"),
1031                 N_("Saturation"),
1032                 minoltaCs5DId, makerTags, unsignedShort, -1, printValue),
1033         TagInfo(0x0035, "ExposureTime", N_("Exposure Time"),
1034                 N_("Exposure time"),
1035                 minoltaCs5DId, makerTags, unsignedShort, -1, printValue),
1036         TagInfo(0x0036, "FNumber", N_("FNumber"),
1037                 N_("The F-Number"),
1038                 minoltaCs5DId, makerTags, unsignedShort, -1, printValue),
1039         TagInfo(0x0037, "FreeMemoryCardImages", N_("Free Memory Card Images"),
1040                 N_("Free memory card images"),
1041                 minoltaCs5DId, makerTags, unsignedShort, -1, printValue),
1042         TagInfo(0x0038, "ExposureRevision", N_("Exposure Revision"),
1043                 N_("Exposure revision"),
1044                 minoltaCs5DId, makerTags, unsignedShort, -1, printValue),
1045         TagInfo(0x0048, "FocusMode", N_("Focus Mode"),
1046                 N_("Focus mode"),
1047                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaFocusModeStd)),
1048         TagInfo(0x0049, "ColorTemperature", N_("Color Temperature"),
1049                 N_("Color temperature"),
1050                 minoltaCs5DId, makerTags, signedShort, -1, printValue),
1051         TagInfo(0x0050, "Rotation", N_("Rotation"),
1052                 N_("Rotation"),
1053                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaRotation5D)),
1054         TagInfo(0x0053, "ExposureCompensation", N_("Exposure Compensation"),
1055                 N_("Exposure compensation"),
1056                 minoltaCs5DId, makerTags, unsignedShort, -1, printMinoltaExposureCompensation5D),
1057         TagInfo(0x0054, "FreeMemoryCardImages", N_("Free Memory Card Images"),
1058                 N_("Free memory card images"),
1059                 minoltaCs5DId, makerTags, unsignedShort, -1, printValue),
1060         TagInfo(0x0065, "Rotation2", N_("Rotation2"),
1061                 N_("Rotation2"),
1062                 minoltaCs5DId, makerTags, unsignedShort, -1, printMinoltaSonyRotation),
1063         TagInfo(0x006E, "Color Temperature", N_("Color Temperature"),
1064                 N_("Color Temperature"),
1065                 minoltaCs5DId, makerTags, signedShort, -1, printValue),
1066         TagInfo(0x0071, "PictureFinish", N_("Picture Finish"),
1067                 N_("Picture Finish"),
1068                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaPictureFinish5D)),
1069         TagInfo(0x0091, "ExposureManualBias", N_("Exposure Manual Bias"),
1070                 N_("Exposure manual bias"),
1071                 minoltaCs5DId, makerTags, unsignedShort, -1, printMinoltaExposureManualBias5D),
1072         TagInfo(0x009E, "AFMode", N_("AF Mode"),
1073                 N_("AF mode"),
1074                 minoltaCs5DId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(minoltaAFMode5D)),
1075         TagInfo(0x00AE, "ImageNumber", N_("Image Number"),
1076                 N_("Image number"),
1077                 minoltaCs5DId, makerTags, unsignedShort, -1, printValue),
1078         TagInfo(0x00B0, "NoiseReduction", N_("Noise Reduction"),
1079                 N_("Noise reduction"),
1080                 minoltaCs5DId, makerTags, unsignedShort, -1, printMinoltaSonyBoolValue),
1081         TagInfo(0x00BD, "ImageStabilization", N_("Image Stabilization"),
1082                 N_("Image stabilization"),
1083                 minoltaCs5DId, makerTags, unsignedShort, -1, printMinoltaSonyBoolValue),
1084 
1085         // From Xavier Raynaud: some notes on missing tags.
1086         // 0x0051 seems to be identical to FNumber (0x0036). An approx. relation between Tag value
1087         // and Fstop is exp(-0.335+value*0.043)
1088         // 0x0052 seems to be identical to ExposureTime (0x0035). An approx. relation between Tag
1089         // value and Exposure time is exp(-4+value*0.085)
1090 
1091         // End of list marker
1092         TagInfo(0xFFFF, "(UnknownMinoltaCs5DTag)", "(UnknownMinoltaCs5DTag)",
1093                 N_("Unknown Minolta Camera Settings 5D tag"),
1094                 minoltaCs5DId, makerTags, invalidTypeId, -1, printValue)
1095     };
1096 
tagListCs5D()1097     const TagInfo* MinoltaMakerNote::tagListCs5D()
1098     {
1099         return tagInfoCs5D_;
1100     }
1101 
1102     // -- Sony A100 camera settings ---------------------------------------------------------------
1103 
1104     //! Lookup table to translate Sony A100 camera settings drive mode 2 values to readable labels
1105     extern const TagDetails sonyDriveMode2A100[] = {
1106         { 0,    N_("Self-timer 10 sec")             },
1107         { 1,    N_("Continuous")                    },
1108         { 4,    N_("Self-timer 2 sec")              },
1109         { 5,    N_("Single Frame")                  },
1110         { 8,    N_("White Balance Bracketing Low")  },
1111         { 9,    N_("White Balance Bracketing High") },
1112         { 770,  N_("Single-frame Bracketing Low")   },
1113         { 771,  N_("Continuous Bracketing Low")     },
1114         { 1794, N_("Single-frame Bracketing High")  },
1115         { 1795, N_("Continuous Bracketing High")    }
1116     };
1117 
1118     //! Lookup table to translate Sony A100 camera settings focus mode values to readable labels
1119     extern const TagDetails sonyFocusModeA100[] = {
1120         { 0, "AF-S"   },
1121         { 1, "AF-C"   },
1122         { 4, "AF-A"   },
1123         { 5, "Manual" },
1124         { 6, "DMF"    }
1125     };
1126 
1127     //! Lookup table to translate Sony A100 camera settings flash mode values to readable labels
1128     extern const TagDetails sonyFlashModeA100[] = {
1129         { 0, N_("Auto")            },
1130         { 2, N_("Rear flash sync") },
1131         { 3, N_("Wireless")        },
1132         { 4, N_("Fill flash")      }
1133     };
1134 
1135     //! Lookup table to translate Sony A100 camera settings metering mode values to readable labels
1136     extern const TagDetails sonyMeteringModeA100[] = {
1137         { 0, N_("Multi-segment")           },
1138         { 1, N_("Center weighted average") },
1139         { 2, N_("Spot")                    }
1140     };
1141 
1142     //! Lookup table to translate Sony A100 camera settings zone matching mode values to readable labels
1143     extern const TagDetails sonyZoneMatchingModeA100[] = {
1144         { 0,    N_("Off")      },
1145         { 1,    N_("Standard") },
1146         { 2,    N_("Advanced") }
1147     };
1148 
1149     //! Lookup table to translate Sony A100 camera settings color space values to readable labels
1150 
1151     extern const TagDetails sonyColorSpaceA100[] = {
1152         { 0, N_("sRGB")      },
1153         { 5, N_("Adobe RGB") }
1154     };
1155 
1156     //! Lookup table to translate Sony A100 camera settings drive mode values to readable labels
1157     extern const TagDetails sonyDriveModeA100[] = {
1158         { 0, N_("Single Frame")             },
1159         { 1, N_("Continuous")               },
1160         { 2, N_("Self-timer")               },
1161         { 3, N_("Continuous Bracketing")    },
1162         { 4, N_("Single-Frame Bracketing")  },
1163         { 5, N_("White Balance Bracketing") }
1164     };
1165 
1166     //! Lookup table to translate Sony A100 camera settings self timer time values to readable labels
1167     extern const TagDetails sonySelfTimerTimeA100[] = {
1168         { 0, "10s" },
1169         { 4, "2s"  }
1170     };
1171 
1172     //! Lookup table to translate Sony A100 camera settings continuous bracketing values to readable labels
1173     extern const TagDetails sonyContinuousBracketingA100[] = {
1174         { 0x303, N_("Low")  },
1175         { 0x703, N_("High") }
1176     };
1177 
1178     //! Lookup table to translate Sony A100 camera settings single frame bracketing values to readable labels
1179     extern const TagDetails sonySingleFrameBracketingA100[] = {
1180         { 0x302, N_("Low")  },
1181         { 0x702, N_("High") }
1182     };
1183 
1184     //! Lookup table to translate Sony A100 camera settings white balance bracketing values to readable labels
1185     extern const TagDetails sonyWhiteBalanceBracketingA100[] = {
1186         { 0x8, N_("Low")  },
1187         { 0x9, N_("High") }
1188     };
1189 
1190     //! Lookup table to translate Sony A100 camera settings white balance setting values to readable labels
1191     extern const TagDetails sonyWhiteBalanceSettingA100[] = {
1192         { 0x0000, N_("Auto")                           },
1193         { 0x0001, N_("Preset")                         },
1194         { 0x0002, N_("Custom")                         },
1195         { 0x0003, N_("Color Temperature/Color Filter") },
1196         { 0x8001, N_("Preset")                         },
1197         { 0x8002, N_("Custom")                         },
1198         { 0x8003, N_("Color Temperature/Color Filter") }
1199     };
1200 
1201     //! Lookup table to translate Sony A100 camera settings preset white balance values to readable labels
1202     extern const TagDetails sonyPresetWhiteBalanceA100[] = {
1203         { 1, N_("Daylight")    },
1204         { 2, N_("Cloudy")      },
1205         { 3, N_("Shade")       },
1206         { 4, N_("Tungsten")    },
1207         { 5, N_("Fluorescent") },
1208         { 6, N_("Flash")       }
1209     };
1210 
1211     //! Lookup table to translate Sony A100 camera settings color temperature setting values to readable labels
1212     extern const TagDetails sonyColorTemperatureSettingA100[] = {
1213         { 0, N_("Temperature")  },
1214         { 2, N_("Color Filter") }
1215     };
1216 
1217     //! Lookup table to translate Sony A100 camera settings custom WB setting values to readable labels
1218     extern const TagDetails sonyCustomWBSettingA100[] = {
1219         { 0, N_("Setup")  },
1220         { 2, N_("Recall") }
1221     };
1222 
1223     //! Lookup table to translate Sony A100 camera settings custom WB error values to readable labels
1224     extern const TagDetails sonyCustomWBErrorA100[] = {
1225         { 0, N_("Ok")    },
1226         { 2, N_("Error") }
1227     };
1228 
1229     //! Lookup table to translate Sony A100 camera settings image size values to readable labels
1230     extern const TagDetails sonyImageSizeA100[] = {
1231         { 0, N_("Standard") },
1232         { 1, N_("Medium")   },
1233         { 2, N_("Small")    }
1234     };
1235 
1236     //! Lookup table to translate Sony A100 camera settings instant playback setup values to readable labels
1237     extern const TagDetails sonyInstantPlaybackSetupA100[] = {
1238         { 0, N_("Image and Information") },
1239         { 1, N_("Image Only")            },
1240         { 3, N_("Image and Histogram")   }
1241     };
1242 
1243     //! Lookup table to translate Sony A100 camera settings flash default setup values to readable labels
1244     extern const TagDetails sonyFlashDefaultA100[] = {
1245         { 0, N_("Auto")       },
1246         { 1, N_("Fill Flash") }
1247     };
1248 
1249     //! Lookup table to translate Sony A100 camera settings auto bracket order values to readable labels
1250     extern const TagDetails sonyAutoBracketOrderA100[] = {
1251         { 0, "0-+" },
1252         { 1, "-0+" }
1253     };
1254 
1255     //! Lookup table to translate Sony A100 camera settings focus hold button values to readable labels
1256     extern const TagDetails sonyFocusHoldButtonA100[] = {
1257         { 0, N_("Focus Hold")  },
1258         { 1, N_("DOF Preview") }
1259     };
1260 
1261     //! Lookup table to translate Sony A100 camera settings AEL button values to readable labels
1262     extern const TagDetails sonyAELButtonA100[] = {
1263         { 0, N_("Hold")        },
1264         { 1, N_("Toggle")      },
1265         { 2, N_("Spot Hold")   },
1266         { 3, N_("Spot Toggle") }
1267     };
1268 
1269     //! Lookup table to translate Sony A100 camera settings control dial set values to readable labels
1270     extern const TagDetails sonyControlDialSetA100[] = {
1271         { 0, N_("Shutter Speed") },
1272         { 1, N_("Aperture")      }
1273     };
1274 
1275     //! Lookup table to translate Sony A100 camera settings exposure compensation mode values to readable labels
1276     extern const TagDetails sonyExposureCompensationModeA100[] = {
1277         { 0, N_("Ambient and Flash") },
1278         { 1, N_("Ambient Only")      }
1279     };
1280 
1281     //! Lookup table to translate Sony A100 camera settings sony AF area illumination values to readable labels
1282     extern const TagDetails sonyAFAreaIlluminationA100[] = {
1283         { 0, N_("0.3 seconds") },
1284         { 1, N_("0.6 seconds") },
1285         { 2, N_("Off")         }
1286     };
1287 
1288     //! Lookup table to translate Sony A100 camera settings monitor display off values to readable labels
1289     extern const TagDetails sonyMonitorDisplayOffA100[] = {
1290         { 0, N_("Automatic") },
1291         { 1, N_("Manual")    }
1292     };
1293 
1294     //! Lookup table to translate Sony A100 camera settings record display values to readable labels
1295     extern const TagDetails sonyRecordDisplayA100[] = {
1296         { 0, N_("Auto-rotate") },
1297         { 1, N_("Horizontal")  }
1298     };
1299 
1300     //! Lookup table to translate Sony A100 camera settings play display values to readable labels
1301     extern const TagDetails sonyPlayDisplayA100[] = {
1302         { 0, N_("Auto-rotate")   },
1303         { 1, N_("Manual Rotate") }
1304     };
1305 
1306     //! Lookup table to translate Sony A100 camera settings metering off scale indicator values to readable labels
1307     extern const TagDetails sonyMeteringOffScaleIndicatorA100[] = {
1308         { 0,   N_("Within Range")     },
1309         { 1,   N_("Under/Over Range") },
1310         { 255, N_("Out of Range")     }
1311     };
1312 
1313     //! Lookup table to translate Sony A100 camera settings exposure indicator values to readable labels
1314     extern const TagDetails sonyExposureIndicatorA100[] = {
1315         { 0,   N_("Not Indicated")   },
1316         { 1,   N_("Under Scale")     },
1317         { 119, N_("Bottom of Scale") },
1318         { 120, "-2.0"                },
1319         { 121, "-1.7"                },
1320         { 122, "-1.5"                },
1321         { 123, "-1.3"                },
1322         { 124, "-1.0"                },
1323         { 125, "-0.7"                },
1324         { 126, "-0.5"                },
1325         { 127, "-0.3"                },
1326         { 128, "-0.0"                },
1327         { 129, "+0.3"                },
1328         { 130, "+0.5"                },
1329         { 131, "+0.7"                },
1330         { 132, "+1.0"                },
1331         { 133, "+1.3"                },
1332         { 134, "+1.5"                },
1333         { 135, "+1.7"                },
1334         { 136, "+2.0"                },
1335         { 253, N_("Top of Scale")    },
1336         { 254, N_("Over Scale")      }
1337     };
1338 
1339     //! Lookup table to translate Sony A100 camera settings focus mode switch values to readable labels
1340     extern const TagDetails sonyFocusModeSwitchA100[] = {
1341         { 0, N_("AM") },
1342         { 1, N_("MF") }
1343     };
1344 
1345     //! Lookup table to translate Sony A100 camera settings flash type switch values to readable labels
1346     extern const TagDetails sonyFlashTypeA100[] = {
1347         { 0, N_("Off")      },
1348         { 1, N_("Built-in") },
1349         { 2, N_("External") }
1350     };
1351 
1352     //! Lookup table to translate Sony A100 camera settings battery level switch values to readable labels
1353     extern const TagDetails sonyBatteryLevelA100[] = {
1354         { 3, N_("Very Low")                   },
1355         { 4, N_("Low")                        },
1356         { 5, N_("Half Full")                  },
1357         { 6, N_("Sufficient Power Remaining") }
1358     };
1359 
1360     // Sony A100 Camera Settings Tag Info
1361     const TagInfo MinoltaMakerNote::tagInfoCsA100_[] = {
1362         TagInfo(0x0000, "ExposureMode", N_("Exposure Mode"),
1363                 N_("Exposure mode"),
1364                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaExposureMode5D)),
1365         TagInfo(0x0001, "ExposureCompensationSetting", N_("Exposure Compensation Setting"),
1366                 N_("Exposure compensation setting"),
1367                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1368         TagInfo(0x0005, "HighSpeedSync", N_("High Speed Sync"),
1369                 N_("High speed sync"),
1370                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyBoolValue),
1371         TagInfo(0x0006, "ManualExposureTime", N_("Manual Exposure Time"),
1372                 N_("Manual exposure time"),
1373                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1374         TagInfo(0x0007, "ManualFNumber", N_("Manual FNumber"),
1375                 N_("Manual FNumber"),
1376                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1377         TagInfo(0x0008, "ExposureTime", N_("Exposure Time"),
1378                 N_("Exposure time"),
1379                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1380         TagInfo(0x0009, "FNumber", N_("FNumber"),
1381                 N_("FNumber"),
1382                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1383         TagInfo(0x000A, "DriveMode2", N_("Drive Mode 2"),
1384                 N_("Drive mode 2"),
1385                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyDriveMode2A100)),
1386         TagInfo(0x000B, "WhiteBalance", N_("White Balance"),
1387                 N_("White balance"),
1388                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaWhiteBalance5D)),
1389         TagInfo(0x000C, "FocusMode", N_("Focus Mode"),
1390                 N_("Focus mode"),
1391                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyFocusModeA100)),
1392         TagInfo(0x000D, "LocalAFAreaPoint", N_("Local AF Area Point"),
1393                 N_("Local AF Area Point"),
1394                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyLocalAFAreaPoint),
1395         TagInfo(0x000E, "AFAreaMode", N_("AF Area Mode"),
1396                 N_("AF Area Mode"),
1397                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyAFAreaMode),
1398         TagInfo(0x000F, "FlashMode", N_("FlashMode"),
1399                 N_("FlashMode"),
1400                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyFlashModeA100)),
1401         TagInfo(0x0010, "FlashExposureCompSetting", N_("Flash Exposure Comp Setting"),
1402                 N_("Flash exposure compensation setting"),
1403                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1404         TagInfo(0x0012, "MeteringMode", N_("Metering Mode"),
1405                 N_("Metering mode"),
1406                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyMeteringModeA100)),
1407         TagInfo(0x0013, "ISOSetting", N_("ISO Setting"),
1408                 N_("ISO setting"),
1409                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1410         TagInfo(0x0014, "ZoneMatchingMode", N_("Zone Matching Mode"),
1411                 N_("Zone Matching Mode"),
1412                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyZoneMatchingModeA100)),
1413         TagInfo(0x0015, "DynamicRangeOptimizerMode", N_("Dynamic Range Optimizer Mode"),
1414                 N_("Dynamic range optimizer mode"),
1415                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyDynamicRangeOptimizerMode),
1416         TagInfo(0x0016, "ColorMode", N_("Color Mode"),
1417                 N_("Color mode"),
1418                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyColorMode),
1419         TagInfo(0x0017, "ColorSpace", N_("Color Space"),
1420                 N_("Color space"),
1421                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyColorSpaceA100)),
1422         TagInfo(0x0018, "Sharpness", N_("Sharpness"),
1423                 N_("Sharpness"),
1424                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1425         TagInfo(0x0019, "Contrast", N_("Contrast"),
1426                 N_("Contrast"),
1427                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1428         TagInfo(0x001A, "Saturation", N_("Saturation"),
1429                 N_("Saturation"),
1430                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1431         TagInfo(0x001C, "FlashMetering", N_("Flash Metering"),
1432                 N_("Flash metering"),
1433                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(minoltaFlashMeteringStd)),
1434         TagInfo(0x001D, "PrioritySetupShutterRelease", N_("Priority Setup Shutter Release"),
1435                 N_("Priority Setup Shutter Release"),
1436                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyPrioritySetupShutterRelease),
1437         TagInfo(0x001E, "DriveMode", N_("Drive Mode"),
1438                 N_("Drive mode"),
1439                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyDriveModeA100)),
1440         TagInfo(0x001F, "SelfTimerTime", N_("Self Timer Time"),
1441                 N_("Self timer time"),
1442                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonySelfTimerTimeA100)),
1443         TagInfo(0x0020, "ContinuousBracketing", N_("Continuous Bracketing"),
1444                 N_("Continuous bracketing"),
1445                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyContinuousBracketingA100)),
1446         TagInfo(0x0021, "SingleFrameBracketing", N_("Single Frame Bracketing"),
1447                 N_("Single frame bracketing"),
1448                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonySingleFrameBracketingA100)),
1449         TagInfo(0x0022, "WhiteBalanceBracketing", N_("White Balance Bracketing"),
1450                 N_("White balance bracketing"),
1451                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyWhiteBalanceBracketingA100)),
1452         TagInfo(0x0023, "WhiteBalanceSetting", N_("White Balance Setting"),
1453                 N_("White balance setting"),
1454                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyWhiteBalanceSettingA100)),
1455         TagInfo(0x0024, "PresetWhiteBalance", N_("Preset White Balance"),
1456                 N_("Preset white balance"),
1457                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyPresetWhiteBalanceA100)),
1458         TagInfo(0x0025, "ColorTemperatureSetting", N_("Color Temperature Setting"),
1459                 N_("Color temperature setting"),
1460                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyColorTemperatureSettingA100)),
1461         TagInfo(0x0026, "CustomWBSetting", N_("Custom WB Setting"),
1462                 N_("Custom WB setting"),
1463                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyCustomWBSettingA100)),
1464         TagInfo(0x0027, "DynamicRangeOptimizerSettings", N_("Dynamic Range Optimizer Settings"),
1465                 N_("Dynamic Range Optimizer Settings"),
1466                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyDynamicRangeOptimizerMode),
1467         TagInfo(0x0032, "FreeMemoryCardImages", N_("Free Memory Card Images"),
1468                 N_("Free memory card images"),
1469                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1470         TagInfo(0x0034, "CustomWBRedLevel", N_("Custom WB Red Level"),
1471                 N_("Custom WB red level"),
1472                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1473         TagInfo(0x0035, "CustomWBGreenLevel", N_("Custom WB Green Level"),
1474                 N_("Custom WB green level"),
1475                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1476         TagInfo(0x0036, "CustomWBBlueLevel", N_("Custom WB Blue Level"),
1477                 N_("CustomWB blue level"),
1478                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1479         TagInfo(0x0037, "CustomWBError", N_("Custom WB Error"),
1480                 N_("Custom WB Error"),
1481                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyCustomWBErrorA100)),
1482         TagInfo(0x0038, "WhiteBalanceFineTune", N_("White Balance Fine Tune"),
1483                 N_("White balance fine tune"),
1484                 sony1MltCsA100Id, makerTags, signedShort, 1, printValue),
1485         TagInfo(0x0039, "ColorTemperature", N_("Color Temperature"),
1486                 N_("Color temperature"),
1487                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1488         TagInfo(0x003A, "ColorCompensationFilter", N_("Color Compensation Filter"),
1489                 N_("Color compensation filter"),
1490                 sony1MltCsA100Id, makerTags, signedShort, 1, printValue),
1491         TagInfo(0x003B, "SonyImageSize", N_("Sony Image Size"),
1492                 N_("Sony Image Size"),
1493                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyImageSizeA100)),
1494         TagInfo(0x003C, "Quality", N_("Quality"),
1495                 N_("Quality"),
1496                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyQualityCs),
1497         TagInfo(0x003D, "InstantPlaybackTime", N_("Instant Playback Time"),
1498                 N_("Instant playback time"),
1499                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue),
1500         TagInfo(0x003E, "InstantPlaybackSetup", N_("Instant Playback Setup"),
1501                 N_("Instant playback setup"),
1502                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyInstantPlaybackSetupA100)),
1503         TagInfo(0x003F, "NoiseReduction", N_("Noise Reduction"),
1504                 N_("Noise reduction"),
1505                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyBoolValue),
1506         TagInfo(0x0040, "EyeStartAF", N_("Eye Start AF"),
1507                 N_("Eye start AF"),
1508                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyBoolInverseValue),
1509         TagInfo(0x0041, "RedEyeReduction", N_("Red Eye Reduction"),
1510                 N_("Red eye reduction"),
1511                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyBoolValue),
1512         TagInfo(0x0042, "FlashDefault", N_("Flash Default"),
1513                 N_("Flash default"),
1514                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyFlashDefaultA100)),
1515         TagInfo(0x0043, "AutoBracketOrder", N_("Auto Bracket Order"),
1516                 N_("Auto bracket order"),
1517                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyAutoBracketOrderA100)),
1518         TagInfo(0x0044, "FocusHoldButton", N_("Focus Hold Button"),
1519                 N_("Focus hold button"),
1520                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyFocusHoldButtonA100)),
1521         TagInfo(0x0045, "AELButton", N_("AEL Button"),
1522                 N_("AEL button"),
1523                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyAELButtonA100)),
1524         TagInfo(0x0046, "ControlDialSet", N_("Control Dial Set"),
1525                 N_("Control dial set"),
1526                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyControlDialSetA100)),
1527         TagInfo(0x0047, "ExposureCompensationMode", N_("Exposure Compensation Mode"),
1528                 N_("Exposure compensation mode"),
1529                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyExposureCompensationModeA100)),
1530         TagInfo(0x0048, "AFAssist", N_("AF Assist"),
1531                 N_("AF assist"),
1532                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyBoolInverseValue),
1533         TagInfo(0x0049, "CardShutterLock", N_("Card Shutter Lock"),
1534                 N_("Card shutter lock"),
1535                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyBoolInverseValue),
1536         TagInfo(0x004A, "LensShutterLock", N_("Lens Shutter Lock"),
1537                 N_("Lens shutter lock"),
1538                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyBoolInverseValue),
1539         TagInfo(0x004B, "AFAreaIllumination", N_("AF Area Illumination"),
1540                 N_("AF area illumination"),
1541                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyAFAreaIlluminationA100)),
1542         TagInfo(0x004C, "MonitorDisplayOff", N_("Monitor Display Off"),
1543                 N_("Monitor display off"),
1544                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyMonitorDisplayOffA100)),
1545         TagInfo(0x004D, "RecordDisplay", N_("Record Display"),
1546                 N_("Record display"),
1547                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyRecordDisplayA100)),
1548         TagInfo(0x004E, "PlayDisplay", N_("Play Display"),
1549                 N_("Play display"),
1550                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyPlayDisplayA100)),
1551         TagInfo(0x0050, "ExposureIndicator", N_("Exposure Indicator"),
1552                 N_("Exposure indicator"),
1553                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyExposureIndicatorA100)),
1554         TagInfo(0x0051, "AELExposureIndicator", N_("AEL Exposure Indicator"),
1555                 N_("AEL exposure indicator (also indicates exposure for next shot when bracketing)"),
1556                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyExposureIndicatorA100)),
1557         TagInfo(0x0052, "ExposureBracketingIndicatorLast", N_("Exposure Bracketing Indicator Last"),
1558                 N_("Exposure bracketing indicator last (indicator for last shot when bracketing)"),
1559                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyExposureIndicatorA100)),
1560         TagInfo(0x0053, "MeteringOffScaleIndicator", N_("Metering Off Scale Indicator"),
1561                 N_("Metering off scale indicator (two flashing triangles when under or over metering scale)"),
1562                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyMeteringOffScaleIndicatorA100)),
1563         TagInfo(0x0054, "FlashExposureIndicator", N_("Flash Exposure Indicator"),
1564                 N_("Flash exposure indicator"),
1565                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyExposureIndicatorA100)),
1566         TagInfo(0x0055, "FlashExposureIndicatorNext", N_("Flash Exposure Indicator Next"),
1567                 N_("Flash exposure indicator next (indicator for next shot when bracketing)"),
1568                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyExposureIndicatorA100)),
1569         TagInfo(0x0056, "FlashExposureIndicatorLast", N_("Flash Exposure Indicator Last"),
1570                 N_("Flash exposure indicator last (indicator for last shot when bracketing)"),
1571                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyExposureIndicatorA100)),
1572         TagInfo(0x0057, "ImageStabilization", N_("Image Stabilization"),
1573                 N_("Image stabilization"),
1574                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyBoolValue),
1575         TagInfo(0x0058, "FocusModeSwitch", N_("Focus Mode Switch"),
1576                 N_("Focus mode switch"),
1577                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyFocusModeSwitchA100)),
1578         TagInfo(0x0059, "FlashType", N_("Flash Type"),
1579                 N_("Flash type"),
1580                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyFlashTypeA100)),
1581         TagInfo(0x005A, "Rotation", N_("Rotation"),
1582                 N_("Rotation"),
1583                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyRotation),
1584         TagInfo(0x004B, "AELock", N_("AE Lock"),
1585                 N_("AE lock"),
1586                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printMinoltaSonyBoolValue),
1587         TagInfo(0x005E, "ColorTemperature", N_("Color Temperature"),
1588                 N_("Color temperature"),
1589                 sony1MltCsA100Id, makerTags, unsignedLong, 1, printValue),
1590         TagInfo(0x005F, "ColorCompensationFilter", N_("Color Compensation Filter"),
1591                 N_("Color compensation filter: negative is green, positive is magenta"),
1592                 sony1MltCsA100Id, makerTags, unsignedLong, 1, printValue),
1593         TagInfo(0x0060, "BatteryLevel", N_("Battery Level"),
1594                 N_("Battery level"),
1595                 sony1MltCsA100Id, makerTags, unsignedShort, 1, EXV_PRINT_TAG(sonyBatteryLevelA100)),
1596         // End of list marker
1597         TagInfo(0xffff, "(UnknownSonyCsA100Tag)", "(UnknownSonyCsA100Tag)",
1598                 N_("Unknown Sony Camera Settings A100 tag"),
1599                 sony1MltCsA100Id, makerTags, unsignedShort, 1, printValue)
1600     };
1601 
tagListCsA100()1602     const TagInfo* MinoltaMakerNote::tagListCsA100()
1603     {
1604         return tagInfoCsA100_;
1605     }
1606 
1607     // TODO : Add camera settings tags info "New2"...
1608 
1609     // -- Minolta and Sony MakerNote Common Values ---------------------------------------
1610 
1611     //! Lookup table to translate Minolta/Sony Lens id values to readable labels
1612     /* NOTE:
1613        - duplicate tags value are:
1614        0/25520, 4/25920, 13/25610, 19/25910, 22/26050/26070,
1615        25500/25501/26130, 25540/25541/25850, 25580/25581, 2564025641,
1616        25720/25721, 25790/25791, 25960/25961, 25980/25981, 26150/26151
1617        - No need to i18n these string.
1618     */
1619     extern TagDetails const minoltaSonyLensID[] = {
1620         { 0,     "Minolta AF 28-85mm F3.5-4.5 New" },
1621         { 1,     "Minolta AF 80-200mm F2.8 HS-APO G" },
1622         { 2,     "Minolta AF 28-70mm F2.8 G" },
1623         { 3,     "Minolta AF 28-80mm F4-5.6" },
1624         { 4,     "Minolta AF 85mm F1.4G" },
1625         { 5,     "Minolta AF 35-70mm F3.5-4.5 [II]" },
1626         { 6,     "Minolta AF 24-85mm F3.5-4.5 [New]" },
1627         { 7,     "Minolta AF 100-300mm F4.5-5.6 (D) APO [New] | "
1628                  "Minolta AF 100-400mm F4.5-6.7 (D) | "
1629                  "Sigma AF 100-300mm F4 EX DG IF" },
1630         { 8,     "Minolta AF 70-210mm F4.5-5.6 [II]" },
1631         { 9,     "Minolta AF 50mm F3.5 Macro" },
1632         { 10,    "Minolta AF 28-105mm F3.5-4.5 [New]" },
1633         { 11,    "Minolta AF 300mm F4 HS-APO G" },
1634         { 12,    "Minolta AF 100mm F2.8 Soft Focus" },
1635         { 13,    "Minolta AF 75-300mm F4.5-5.6 (New or II)" },
1636         { 14,    "Minolta AF 100-400mm F4.5-6.7 APO" },
1637         { 15,    "Minolta AF 400mm F4.5 HS-APO G" },
1638         { 16,    "Minolta AF 17-35mm F3.5 G" },
1639         { 17,    "Minolta AF 20-35mm F3.5-4.5" },
1640         { 18,    "Minolta AF 28-80mm F3.5-5.6 II" },
1641         { 19,    "Minolta AF 35mm F1.4 G" },
1642         { 20,    "Minolta/Sony 135mm F2.8 [T4.5] STF" },
1643         { 22,    "Minolta AF 35-80mm F4-5.6 II" },
1644         { 23,    "Minolta AF 200mm F4 Macro APO G" },
1645         { 24,    "Minolta/Sony AF 24-105mm F3.5-4.5 (D) | "
1646                  "Sigma 18-50mm F2.8 | "
1647                  "Sigma 17-70mm F2.8-4.5 (D) | "
1648                  "Sigma 20-40mm F2.8 EX DG Aspherical IF | "
1649                  "Sigma 18-200mm F3.5-6.3 DC | "
1650                  "Sigma DC 18-125mm F4-5,6 D | "
1651                  "Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro" },
1652         { 25,    "Minolta AF 100-300mm F4.5-5.6 APO (D) | "
1653                  "Sigma 100-300mm F4 EX (APO (D) or D IF) | "
1654                  "Sigma 70mm F2.8 EX DG Macro | "
1655                  "Sigma 20mm F1.8 EX DG Aspherical RF | "
1656                  "Sigma 30mm F1.4 DG EX | "
1657                  "Sigma 24mm F1.8 EX DG ASP Macro" },
1658         { 27,    "Minolta AF 85mm F1.4 G (D)" },
1659         {0x1c,   "Minolta/Sony AF 100mm F2.8 Macro (D) | "                               // 1
1660                  "Tamron SP AF 90mm F2.8 Di Macro | "                                    // 2
1661                  "Tamron SP AF 180mm F3.5 SP Di LD [IF] Macro" },                        // 3
1662         { 29,    "Minolta/Sony AF 75-300mm F4.5-5.6 (D) " },
1663         { 30,    "Minolta AF 28-80mm F3.5-5.6 (D) | "
1664                  "Sigma AF 10-20mm F4-5.6 EX DC | "
1665                  "Sigma AF 12-24mm F4.5-5.6 EX DG | "
1666                  "Sigma 28-70mm EX DG F2.8 | "
1667                  "Sigma 55-200mm F4-5.6 DC" },
1668         { 31,    "Minolta/Sony AF 50mm F2.8 Macro (D) | "
1669                  "Minolta/Sony AF 50mm F3.5 Macro" },
1670         { 32,    "Minolta AF 100-400mm F4.5-6.7 (D) | "
1671                  "Minolta/Sony AF 300mm F2.8G APO (D) SSM" },
1672         { 33,    "Minolta/Sony AF 70-200mm F2.8 APO G (D) SSM" },
1673         { 35,    "Minolta AF 85mm F1.4 G (D) Limited" },
1674         { 36,    "Minolta AF 28-100mm F3.5-5.6 (D)" },
1675         { 38,    "Minolta AF 17-35mm F2.8-4 (D)" },
1676         { 39,    "Minolta AF 28-75mm F2.8 (D)" },
1677         { 40,    "Minolta/Sony AF DT 18-70mm F3.5-5.6 (D) | "
1678                  "Sony AF DT 18-200mm F3.5-6.3" },
1679         {0x29,   "Minolta/Sony AF DT 11-18mm F4.5-5.6 (D) | "                            // 1
1680                  "Tamron SP AF 11-18mm F4.5-5.6 Di II LD Aspherical IF" },               // 2
1681         { 42,    "Minolta/Sony AF DT 18-200mm F3.5-6.3 (D)" },
1682         { 43,    "Sony 35mm F1.4 G (SAL35F14G)" },
1683         { 44,    "Sony 50mm F1.4 (SAL50F14)" },
1684         { 45,    "Carl Zeiss Planar T* 85mm F1.4 ZA (SAL85F14Z)" },
1685         { 46,    "Carl Zeiss Vario-Sonnar T* DT 16-80mm F3.5-4.5 ZA (SAL1680Z)" },
1686         { 47,    "Carl Zeiss Sonnar T* 135mm F1.8 ZA (SAL135F18Z)" },
1687         { 48,    "Carl Zeiss Vario-Sonnar T* 24-70mm F2.8 ZA SSM (SAL2470Z) | "
1688                  "Carl Zeiss Vario-Sonnar T* 24-70mm F2.8 ZA SSM II (SAL2470Z2)" },
1689         { 49,    "Sony AF DT 55-200mm F4-5.6 (SAL55200)" },
1690         { 50,    "Sony AF DT 18-250mm F3.5-6.3 (SAL18250)" },
1691         { 51,    "Sony AF DT 16-105mm F3.5-5.6 (SAL16105)" },
1692 //      { 51,    "Sony AF DT 55-200mm F4-5.5" }, // Anomaly? - unconfirmed.
1693         {0x34,   "Sony 70-300mm F4.5-5.6 G SSM (SAL70300G) | "                           // 1
1694                  "Sony 70-300mm F4.5-5.6 G SSM II (SAL70300G2) | "                       // 2
1695                  "Tamron SP 70-300mm F4-5.6 Di USD | "                                   // 3
1696                  "Tamron SP AF 17-50mm F2.8 XR Di II LD Aspherical"},                    // 4
1697         { 53,    "Sony AF 70-400mm F4.5-5.6 G SSM (SAL70400G)" },
1698         { 54,    "Carl Zeiss Vario-Sonnar T* 16-35mm F2.8 ZA SSM (SAL1635Z) | "
1699                  "Carl Zeiss Vario-Sonnar T* 16-35mm F2.8 ZA SSM II (SAL1635Z2)" },
1700         { 55,    "Sony DT 18-55mm F3.5-5.6 SAM (SAL1855) | "
1701                  "Sony DT 18-55mm F3.5-5.6 SAM II (SAL18552)" },
1702         { 56,    "Sony AF DT 55-200mm F4-5.6 SAM (SAL55200-2)" },
1703         { 57,    "Sony DT 50mm F1.8 SAM (SAL50F18) | "
1704                  "Tamron SP AF 60mm F2 Di II LD [IF] Macro 1:1 | "
1705                  "Tamron 18-270mm F3.5-6.3 Di II PZD" },
1706         { 58,    "Sony AF DT 30mm F2.8 SAM Macro (SAL30M28)" },
1707         { 59,    "Sony 28-75mm F2.8 SAM (SAL2875)" },
1708         { 60,    "Carl Zeiss Distagon T* 24mm F2 ZA SSM (SAL24F20Z)" },
1709         { 61,    "Sony 85mm F2.8 SAM (SAL85F28)" },
1710         { 62,    "Sony DT 35mm F1.8 SAM (SAL35F18)" },
1711         { 63,    "Sony DT 16-50mm F2.8 SSM (SAL1650)" },
1712         { 64,    "Sony 500mm F4.0 G SSM (SAL500F40G)" },
1713         { 65,    "Sony DT 18-135mm F3.5-5.6 SAM (SAL18135)" },
1714         { 66,    "Sony 300mm F2.8 G SSM II (SAL300F28G2)" },
1715         { 67,    "Sony 70-200mm F2.8 G SSM II (SAL70200G2)" },
1716         { 68,    "Sony DT 55-300mm F4.5-5.6 SAM (SAL55300)" },
1717         { 69,    "Sony 70-400mm F4-5.6 G SSM II (SAL70400G2)" },
1718         { 70,    "Sony Carl Zeiss Planar T* 50mm F1.4 ZA SSM (SALF0F14Z)" },
1719         {0x80,   "Sigma 70-200mm F2.8 APO EX DG MACRO | "                                // 1
1720                  "Tamron AF 18-200mm F3.5-6.3 XR Di II LD Aspherical [IF] Macro | "      // 2
1721                  "Tamron AF 28-300mm F3.5-6.3 XR Di LD Aspherical [IF] Macro | "         // 3
1722                  "Tamron 80-300mm F3.5-6.3 | "                                           // 4
1723                  "Tamron AF 28-200mm F3.8-5.6 XR Di Aspherical [IF] MACRO | "            // 5
1724                  "Tamron SP AF 17-35mm F2.8-4 Di LD Aspherical IF | "                    // 6
1725                  "Sigma AF 50-150mm F2.8 EX DC APO HSM II | "                            // 7
1726                  "Sigma 10-20mm F3.5 EX DC HSM | "                                       // 8
1727                  "Sigma 70-200mm F2.8 II EX DG APO MACRO HSM | "                         // 9
1728                  "Sigma 10mm F2.8 EX DC HSM Fisheye | "                                  // 10
1729                  "Sigma 50mm F1.4 EX DG HSM | "                                          // 11
1730                  "Sigma 85mm F1.4 EX DG HSM | "                                          // 12
1731                  "Sigma 24-70mm F2.8 IF EX DG HSM | "                                    // 13
1732                  "Sigma 18-250mm F3.5-6.3 DC OS HSM | "                                  // 14
1733                  "Sigma 17-50mm F2.8 EX DC HSM | "                                       // 15
1734                  "Sigma 17-70mm F2.8-4 DC Macro HSM | "                                  // 16
1735                  "Sigma 150mm F2.8 EX DG OS HSM APO Macro | "                            // 17
1736                  "Sigma 150-500mm F5-6.3 APO DG OS HSM | "                               // 18
1737                  "Tamron AF 28-105mm F4-5.6 [IF] | "                                     // 19
1738                  "Sigma 35mm F1.4 DG HSM | "                                             // 20
1739                  "Sigma 18-35mm F1.8 DC HSM | "                                          // 21
1740                  "Sigma 50-500mm F4.5-6.3 APO DG OS HSM | "                              // 22
1741                  "Sigma 24-105mm F4 DG HSM | Art 013" },                                 // 23
1742         { 129,   "Tamron 200-400mm F5.6 LD | "
1743                  "Tamron 70-300mm F4-5.6 LD" },
1744         { 131,   "Tamron 20-40mm F2.7-3.5 SP Aspherical IF" },
1745         { 135,   "Vivitar 28-210mm F3.5-5.6" },
1746         { 136,   "Tokina EMZ M100 AF 100mm F3.5" },
1747         { 137,   "Cosina 70-210mm F2.8-4 AF" },
1748         { 138,   "Soligor 19-35mm F3.5-4.5" },
1749         { 139,   "Tokina AF 28-300mm F4-6.3" },
1750         { 142,   "Voigtlander 70-300mm F4.5-5.6" },
1751         { 146,   "Voigtlander Macro APO-Lanthar 125mm F2.5 SL" },
1752         { 193,   "Minolta AF 1.4x APO II" },
1753         { 194,   "Tamron SP AF 17-50mm F2.8 XR Di II LD Aspherical [IF]" },
1754         { 202,   "Tamron SP AF 70-200mm F2.8 Di LD [IF] Macro" },
1755         { 203,   "Tamron SP 70-200mm F2.8 Di USD" },
1756         { 204,   "Tamron SP 24-70mm F2.8 Di USD" },
1757         { 212,   "Tamron 28-300mm F3.5-6.3 Di PZD" },
1758         { 213,   "Tamron 16-300mm F3.5-6.3 Di II PZD Macro" },
1759         { 214,   "Tamron Tamron SP 150-600mm F5-6.3 Di USD" },
1760         { 215,   "Tamron SP 15-30mm F2.8 Di USD" },
1761         { 218,   "Tamron SP 90mm F2.8 Di Macro 1:1 USD (F017)" },
1762         { 224,   "Tamron SP 90mm F2.8 Di Macro 1:1 USD (F004)" },
1763         {0xff,   "Tamron SP AF 17-50mm F2.8 XR Di II LD Aspherical | "                   // 1
1764                  "Tamron AF 18-250mm F3.5-6.3 XR Di II LD | "                            // 2
1765                  "Tamron AF 55-200mm F4-5.6 Di II LD Macro | "                           // 3
1766                  "Tamron AF 70-300mm F4-5.6 Di LD Macro 1:2 | "                          // 4
1767                  "Tamron SP AF 200-500mm F5.0-6.3 Di LD IF | "                           // 5
1768                  "Tamron SP AF 10-24mm F3.5-4.5 Di II LD Aspherical IF | "               // 6
1769                  "Tamron SP AF 70-200mm F2.8 Di LD IF Macro | "                          // 7
1770                  "Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical IF | "                   // 8
1771                  "Tamron AF 90-300mm F4.5-5.6 Telemacro"},                               // 9
1772         { 25500, "Minolta AF 50mm F1.7" },
1773         { 25501, "Minolta AF 50mm F1.7" },
1774         { 25510, "Minolta AF 35-70mm F4" },
1775         { 25511, "Minolta AF 35-70mm F4 | "
1776                  "Sigma UC AF 28-70mm F3.5-4.5 | "
1777                  "Sigma AF 28-70mm F2.8 | "
1778                  "Sigma M-AF 70-200mm F2.8 EX Aspherical | "
1779                  "Quantaray M-AF 35-80mm F4-5.6 | "
1780                  "Tokina 28-70mm F2.8-4.5 AF" },
1781         { 25520, "Minolta AF 28-85mm F3.5-4.5" },
1782         { 25521, "Minolta AF 28-85mm F3.5-4.5 | "
1783                  "Tokina 19-35mm F3.5-4.5 | "
1784                  "Tokina 28-70mm F2.8 AT-X | "
1785                  "Tokina 80-400mm F4.5-5.6 AT-X AF II 840 | "
1786                  "Tokina AF PRO 28-80mm F2.8 AT-X 280 | "
1787                  "Tokina AT-X PRO [II] AF 28-70mm F2.6-2.8 270 | "
1788                  "Tamron AF 19-35mm F3.5-4.5 | "
1789                  "Angenieux AF 28-70mm F2.6 | "
1790                  "Tokina AT-X 17 AF 17mm F3.5 | "
1791                  "Tokina 20-35mm F3.5-4.5 II AF" },
1792         { 25530, "Minolta AF 28-135mm F4-4.5" },
1793         { 25531, "Minolta AF 28-135mm F4-4.5 | "
1794                  "Sigma ZOOM-alpha 35-135mm F3.5-4.5 | "
1795                  "Sigma 28-105mm F2.8-4 Aspherical | "
1796                  "Sigma 28-105mm F4-5.6 UC" },
1797         { 25540, "Minolta AF 35-105mm F3.5-4.5" },
1798         { 25541, "Minolta AF 35-105mm F3.5-4.5" },
1799         { 25550, "Minolta AF 70-210mm F4" },
1800         { 25551, "Minolta AF 70-210mm F4 Macro | "
1801                  "Sigma 70-210mm F4-5.6 APO | "
1802                  "Sigma M-AF 70-200mm F2.8 EX APO | "
1803                  "Sigma 75-200mm F2.8-3.5" },
1804         { 25560, "Minolta AF 135mm F2.8" },
1805         { 25561, "Minolta AF 135mm F2.8" },
1806         { 25570, "Minolta AF 28mm F2.8" },
1807         { 25571, "Minolta/Sony AF 28mm F2.8" },
1808         { 25580, "Minolta AF 24-50mm F4" },
1809         { 25581, "Minolta AF 24-50mm F4" },
1810         { 25600, "Minolta AF 100-200mm F4.5" },
1811         { 25601, "Minolta AF 100-200mm F4.5" },
1812         { 25610, "Minolta AF 75-300mm F4.5-5.6" },
1813         { 25611, "Minolta AF 75-300mm F4.5-5.6 | "
1814                  "Sigma 70-300mm F4-5.6 DL Macro | "
1815                  "Sigma 300mm F4 APO Macro | "
1816                  "Sigma AF 500mm F4.5 APO | "
1817                  "Sigma AF 170-500mm F5-6.3 APO Aspherical | "
1818                  "Tokina AT-X AF 300mm F4 | "
1819                  "Tokina AT-X AF 400mm F5.6 SD | "
1820                  "Tokina AF 730 II 75-300mm F4.5-5.6 | "
1821                  "Sigma 800mm F5.6 APO | "
1822                  "Sigma AF 400mm F5.6 APO Macro" },
1823         { 25620, "Minolta AF 50mm F1.4" },
1824         { 25621, "Minolta AF 50mm F1.4 [New]" },
1825         { 25630, "Minolta AF 300mm F2.8G APO" },
1826         { 25631, "Minolta AF 300mm F2.8 APO | "
1827                  "Sigma AF 50-500mm F4-6.3 EX DG APO | "
1828                  "Sigma AF 170-500mm F5-6.3 APO Aspherical | "
1829                  "Sigma AF 500mm F4.5 EX DG APO | "
1830                  "Sigma 400mm F5.6 APO" },
1831         { 25640, "Minolta AF 50mm F2.8 Macro" },
1832         { 25641, "Minolta AF 50mm F2.8 Macro | "
1833                  "Sigma 50mm F2.8 EX Macro" },
1834         { 25650, "Minolta AF 600mm F4 APO" },
1835         { 25651, "Minolta AF 600mm F4 APO" },
1836         { 25660, "Minolta AF 24mm F2.8" },
1837         { 25661, "Minolta AF 24mm F2.8 | "
1838                  "Sigma 17-35mm F2.8-4.0 EX-D" },
1839         { 25720, "Minolta AF 500mm F8 Reflex" },
1840         { 25721, "Minolta/Sony AF 500mm F8 Reflex" },
1841         { 25780, "Minolta/Sony AF 16mm F2.8 Fisheye" },
1842         { 25781, "Minolta/Sony AF 16mm F2.8 Fisheye | "
1843                  "Sigma 8mm F4 EX [DG] Fisheye | "
1844                  "Sigma 14mm F3.5 | "
1845                  "Sigma 15mm F2.8 Fisheye" },
1846         { 25790, "Minolta AF 20mm F2.8" },
1847         { 25791, "Minolta/Sony AF 20mm F2.8 | "
1848                  "Tokina AT-X 116 PRO DX AF 11-16mm F2.8" },
1849         { 25810, "Minolta AF 100mm F2.8 Macro" },
1850         { 25811, "Minolta AF 100mm F2.8 Macro [New] | "
1851                  "Sigma AF 90mm F2.8 Macro | "
1852                  "Sigma AF 105mm F2.8 EX [DG] Macro | "
1853                  "Sigma 180mm F5.6 Macro | "
1854                  "Sigma 180mm F3.5 EX DG Macro | "
1855                  "Tamron 90mm F2.8 Macro" },
1856         { 25850, "Minolta AF 35-105mm F3.5-4.5" },
1857         { 25851, "Beroflex 35-135mm F3.5-4.5" },
1858         { 25858, "Minolta AF 35-105mm F3.5-4.5 New | "
1859                  "Tamron 24-135mm F3.5-5.6" },
1860         { 25880, "Minolta AF 70-210mm F3.5-4.5" },
1861         { 25881, "Minolta AF 70-210mm F3.5-4.5" },
1862         { 25890, "Minolta AF 80-200mm F2.8 APO" },
1863         { 25891, "Minolta AF 80-200mm F2.8 APO | "
1864                  "Tokina 80-200mm F2.8" },
1865         { 25900, "Minolta AF 200mm F2.8 G APO + Minolta AF 1.4x APO" },
1866         { 25901, "Minolta AF 200mm F2.8 G APO + Minolta AF 1.4x APO | "
1867                  "Minolta AF 600mm F4 HS-APO G + Minolta AF 1.4x APO" },
1868         { 25910, "Minolta AF 35mm F1.4G" },
1869         { 25911, "Minolta AF 35mm F1.4" },
1870         { 25920, "Minolta AF 85mm F1.4G" },
1871         { 25921, "Minolta AF 85mm F1.4G (D)" },
1872         { 25930, "Minolta AF 200mm F2.8 APO" },
1873         { 25931, "Minolta AF 200mm F2.8 APO" },
1874         { 25940, "Minolta AF 3X-1X F1.7-2.8 Macro" },
1875         { 25941, "Minolta AF 3x-1x F1.7-2.8 Macro" },
1876         { 25960, "Minolta AF 28mm F2" },
1877         { 25961, "Minolta AF 28mm F2" },
1878         { 25970, "Minolta AF 35mm F2" },
1879         { 25971, "Minolta AF 35mm F2 [New]" },
1880         { 25980, "Minolta AF 100mm F2" },
1881         { 25981, "Minolta AF 100mm F2" },
1882         { 26010, "Minolta AF 200mm F2.8 G APO + Minolta AF 2x APO" },
1883         { 26011, "Minolta AF 200mm F2.8 G APO + Minolta AF 2x APO | "
1884                  "Minolta AF 600mm F4 HS-APO G + Minolta AF 2x APO" },
1885         { 26040, "Minolta AF 80-200mm F4.5-5.6" },
1886         { 26041, "Minolta AF 80-200mm F4.5-5.6" },
1887         { 26050, "Minolta AF 35-80mm F4-5.6" },
1888         { 26051, "Minolta AF 35-80mm F4-5.6" },
1889         { 26060, "Minolta AF 100-300mm F4.5-5.6" },
1890         { 26061, "Minolta AF 100-300mm F4.5-5.6 (D) | "
1891                  "Sigma 105mm F2.8 Macro EX DG" },
1892         { 26070, "Minolta AF 35-80mm F4-5.6" },
1893         { 26071, "Minolta AF 35-80mm F4-5.6" },
1894         { 26080, "Minolta AF 300mm F2.8 G" },
1895         { 26081, "Minolta AF 300mm F2.8 G APO High Speed" },
1896         { 26090, "Minolta AF 600mm F4 G" },
1897         { 26091, "Minolta AF 600mm F4 G APO High Speed" },
1898         { 26120, "Minolta AF 200mm F2.8 G" },
1899         { 26121, "Minolta AF 200mm F2.8 G APO High Speed" },
1900         { 26130, "Minolta AF 50mm F1.7" },
1901         { 26131, "Minolta AF 50mm F1.7 New" },
1902         { 26150, "Minolta AF 28-105mm F3.5-4.5 Xi" },
1903         { 26151, "Minolta AF 28-105mm F3.5-4.5 xi" },
1904         { 26160, "Minolta AF 35-200mm F4.5-5.6 Xi" },
1905         { 26161, "Minolta AF 35-200mm F4.5-5.6 Xi" },
1906         { 26180, "Minolta AF 28-80mm F4-5.6 Xi" },
1907         { 26181, "Minolta AF 28-80mm F4-5.6 xi" },
1908         { 26190, "Minolta AF 80-200mm F4.5-5.6 Xi" },
1909         { 26191, "Minolta AF 80-200mm F4.5-5.6 Xi" },
1910         { 26201, "Minolta AF 28-70mm F2.8 G" },
1911         { 26210, "Minolta AF 100-300mm F4.5-5.6 Xi" },
1912         { 26211, "Minolta AF 100-300mm F4.5-5.6 xi" },
1913         { 26240, "Minolta AF 35-80mm F4-5.6 Power Zoom" },
1914         { 26241, "Minolta AF 35-80mm F4-5.6 Power Zoom" },
1915         { 26281, "Minolta AF 80-200mm F2.8 HS-APO G" },
1916         { 26291, "Minolta AF 85mm F1.4 New" },
1917         { 26311, "Minolta/Sony AF 100-300mm F4.5-5.6 APO" },
1918         { 26321, "Minolta AF 24-50mm F4 New" },
1919         { 26381, "Minolta AF 50mm F2.8 Macro New" },
1920         { 26391, "Minolta AF 100mm F2.8 Macro" },
1921         { 26411, "Minolta/Sony AF 20mm F2.8 New" },
1922         { 26421, "Minolta AF 24mm F2.8 New" },
1923         { 26441, "Minolta AF 100-400mm F4.5-6.7 APO" },
1924         { 26621, "Minolta AF 50mm F1.4 New" },
1925         { 26671, "Minolta AF 35mm F2 New" },
1926         { 26681, "Minolta AF 28mm F2 New" },
1927         { 26721, "Minolta AF 24-105mm F3.5-4.5 (D)" },
1928         { 45671, "Tokina 70-210mm F4-5.6" },
1929         { 45711, "Vivitar 70-210mm F4.5-5.6" },
1930         { 45741, "Minolta AF200mm F2.8G x2 | "
1931                  "Tokina 300mm F2.8 x2 | "
1932                  "Tokina RF 500mm F8.0 x2 | "
1933                  "Tamron SP AF 90mm F2.5"},
1934         { 45751, "1.4x Teleconverter " },
1935         { 45851, "Tamron SP AF 300mm F2.8 LD IF" },
1936         { 45861, "Tamron SP AF 35-105mm F2.8 LD Aspherical IF" },
1937         { 45871, "Tamron AF 70-210mm F2.8 SP LD" },
1938         { 65280, "Sigma 16mm F2.8 Filtermatic Fisheye" },
1939         {0xffff, "Manual lens | "                        // 1
1940                  "Sony E 50mm F1.8 OSS | "               // 2
1941                  "E PZ 16-50mm F3.5-5.6 OSS"             // 3
1942         }
1943     };
1944 
1945     // ----------------------------------------------------------------------
1946     // #1145 begin - respect lenses with shared LensID
1947 
1948 #if 0
1949     // resolveLensTypeUsingExiftool has been debugged on the Mac
1950     // It's not in service because:
1951     // 1 we don't know the path to the file being processed
1952     // 2 can't work for a remote file as exiftool doesn't handle remote IO
1953     // 3 almost certainly throws an ugly ugly dos box on the screen in Windows
1954     // 4 I haven't asked Phil's permission to do this
1955     static std::ostream& resolveLensTypeUsingExiftool(std::ostream& os, const Value& value,
1956                                                  const ExifData* metadata)
1957     {
1958 // #if ! defined(WIN32) && ! defined(__CYGWIN__) && ! defined(__MINGW__)
1959 #ifndef _MSC_VER
1960         FILE* f = ::popen("/bin/bash -c \"exiftool ~/temp/screen.jpg | grep 'Lens ID' | cut -d: -f 2 | sed -E -e 's/^ //g'\"","r");
1961         if ( f ) {
1962             char buffer[200];
1963             int  n=::fread(buffer,1,sizeof buffer-1,f);
1964             ::pclose(f);
1965             // just to be sure, add a null byte
1966             if ( 0 <= n && n < (int) sizeof(buffer) ) buffer[n] = 0 ;
1967 
1968             // and stop at any non-printing character such as line-feed
1969             for (int c = 0 ; c < 32 ; c++)
1970                 if ( ::strchr(buffer,c) )
1971                     *::strchr(buffer,c)=0;
1972             return os << buffer;
1973         }
1974 #endif
1975         return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
1976     }
1977 #endif
1978 
getKeyString(const std::string & key,const ExifData * metadata)1979     static std::string getKeyString(const std::string& key,const ExifData* metadata)
1980     {
1981         std::string result;
1982         if ( metadata->findKey(ExifKey(key)) != metadata->end() ) {
1983             result = metadata->findKey(ExifKey(key))->toString();
1984         }
1985         return result;
1986     }
1987 
1988     static long getKeyLong(const std::string& key,const ExifData* metadata,int which=0);
getKeyLong(const std::string & key,const ExifData * metadata,int which)1989     static long getKeyLong(const std::string& key,const ExifData* metadata,int which)
1990     {
1991         long result = -1;
1992         if ( metadata->findKey(ExifKey(key)) != metadata->end() ) {
1993             result = (long) metadata->findKey(ExifKey(key))->toFloat(which);
1994         }
1995         return result;
1996     }
1997 
1998     /*! http://stackoverflow.com/questions/1798112/removing-leading-and-trailing-spaces-from-a-string
1999         trim from left
2000     */
ltrim(std::string & s,const char * t=" \\t\\n\\r\\f\\v")2001     inline std::string& ltrim(std::string& s, const char* t = " \t\n\r\f\v")
2002     {
2003         s.erase(0, s.find_first_not_of(t));
2004         return s;
2005     }
2006 
2007     //! trim from right
rtrim(std::string & s,const char * t=" \\t\\n\\r\\f\\v")2008     inline std::string& rtrim(std::string& s, const char* t = " \t\n\r\f\v")
2009     {
2010         s.erase(s.find_last_not_of(t) + 1);
2011         return s;
2012     }
2013 
2014     //! trim from left & right
trim(std::string & s,const char * t=" \\t\\n\\r\\f\\v")2015     inline std::string& trim(std::string& s, const char* t = " \t\n\r\f\v")
2016     {
2017         return ltrim(rtrim(s, t), t);
2018     }
2019 
2020     //! http://www.sbin.org/doc/HOWTO/C++Programming-HOWTO-7.html
tokenize(const std::string & str,std::vector<std::string> & tokens,const std::string & delimiters=" ")2021     static void tokenize(const std::string& str,
2022                           std::vector<std::string>& tokens,
2023                           const std::string& delimiters = " ")
2024     {
2025         // Skip delimiters at beginning.
2026         std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
2027         // Find first "non-delimiter".
2028         std::string::size_type pos     = str.find_first_of(delimiters, lastPos);
2029 
2030         while (std::string::npos != pos || std::string::npos != lastPos)
2031         {
2032             // Found a token, add it to the vector.
2033             tokens.push_back(str.substr(lastPos, pos - lastPos));
2034             // Skip delimiters.  Note the "not_of"
2035             lastPos = str.find_first_not_of(delimiters, pos);
2036             // Find next "non-delimiter"
2037             pos = str.find_first_of(delimiters, lastPos);
2038         }
2039     }
2040 
inRange(long value,long min,long max)2041     static bool inRange(long value,long min,long max)
2042     {
2043         return min <= value && value <= max;
2044     }
2045 
resolvedLens(std::ostream & os,long lensID,long index)2046     static std::ostream& resolvedLens(std::ostream& os,long lensID,long index)
2047     {
2048         const TagDetails* td = find(minoltaSonyLensID, lensID);
2049         std::vector<std::string> tokens;
2050         tokenize(td[0].label_,tokens,"|");
2051         return os << exvGettext(trim(tokens[index-1]).c_str());
2052     }
2053 
resolveLens0x1c(std::ostream & os,const Value & value,const ExifData * metadata)2054     static std::ostream& resolveLens0x1c(std::ostream& os, const Value& value,
2055                                                  const ExifData* metadata)
2056     {
2057         try {
2058             long lensID = 0x1c;
2059             long index  = 0;
2060 
2061             std::string model   = getKeyString("Exif.Image.Model"    ,metadata);
2062             std::string lens    = getKeyString("Exif.Photo.LensModel",metadata);
2063 
2064             if ( model == "SLT-A77V" && lens == "100mm F2.8 Macro" ) index=2;
2065 
2066             if ( index > 0 ) return resolvedLens(os,lensID,index);
2067         } catch (...) {}
2068         return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
2069     }
2070 
resolveLens0x29(std::ostream & os,const Value & value,const ExifData * metadata)2071     static std::ostream& resolveLens0x29(std::ostream& os, const Value& value,
2072                                                  const ExifData* metadata)
2073     {
2074         try {
2075             long lensID = 0x29;
2076             long index  = 0;
2077 
2078             std::string model   = getKeyString("Exif.Image.Model"    ,metadata);
2079             std::string lens    = getKeyString("Exif.Photo.LensModel",metadata);
2080 
2081             if ( model == "SLT-A77V" && lens == "DT 11-18mm F4.5-5.6" ) index=2;
2082 
2083             if ( index > 0 ) return resolvedLens(os,lensID,index);
2084         } catch (...) {}
2085         return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
2086     }
2087 
resolveLens0x34(std::ostream & os,const Value & value,const ExifData * metadata)2088     static std::ostream& resolveLens0x34(std::ostream& os, const Value& value,
2089                                                  const ExifData* metadata)
2090     {
2091         try {
2092             long lensID = 0x34;
2093             long index  = 0;
2094 
2095             std::string model       = getKeyString("Exif.Image.Model"            ,metadata);
2096             std::string maxAperture = getKeyString("Exif.Photo.MaxApertureValue" ,metadata);
2097             long        focalLength = getKeyLong  ("Exif.Photo.FocalLength"      ,metadata);
2098             std::string F2_8        = "760/256" ;
2099 
2100             if ( model == "SLT-A77V" && maxAperture == F2_8           ) index=4;
2101             if ( model == "SLT-A77V" && inRange(focalLength,70,300)   ) index=3;
2102 
2103             if ( index > 0 ) return resolvedLens(os,lensID,index);
2104         } catch (...) {}
2105         return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
2106     }
2107 
resolveLens0x80(std::ostream & os,const Value & value,const ExifData * metadata)2108     static std::ostream& resolveLens0x80(std::ostream& os, const Value& value,
2109                                                  const ExifData* metadata)
2110     {
2111         try {
2112             long lensID = 0x80;
2113             long index  = 0;
2114 
2115             std::string model       = getKeyString("Exif.Image.Model"    ,metadata);
2116             std::string maxAperture = getKeyString("Exif.Photo.MaxApertureValue" ,metadata);
2117             long        focalLength = getKeyLong  ("Exif.Photo.FocalLength"      ,metadata);
2118             std::string F4          = "1024/256";
2119 
2120             if ( model == "SLT-A77V" && maxAperture == F4  && inRange(focalLength,18,200) ) index=2;
2121 
2122             if ( index > 0 ) return resolvedLens(os,lensID,index);
2123         } catch (...) {}
2124         return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
2125     }
2126 
resolveLens0xff(std::ostream & os,const Value & value,const ExifData * metadata)2127     static std::ostream& resolveLens0xff(std::ostream& os, const Value& value,
2128                                                  const ExifData* metadata)
2129     {
2130         try {
2131             long lensID = 0xff;
2132             long index  = 0   ;
2133 
2134             std::string model       = getKeyString("Exif.Image.Model"            ,metadata);
2135             long        focalLength = getKeyLong  ("Exif.Photo.FocalLength"      ,metadata);
2136             std::string maxAperture = getKeyString("Exif.Photo.MaxApertureValue" ,metadata);
2137             std::string F2_8        = "760/256" ;
2138 
2139             if ( model == "SLT-A77V" && maxAperture == F2_8 && inRange(focalLength,17,50) ) index = 1 ;
2140 
2141             if ( index > 0 ) return resolvedLens(os,lensID,index);
2142         } catch (...) {}
2143         return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
2144     }
2145 
resolveLens0xffff(std::ostream & os,const Value & value,const ExifData * metadata)2146     static std::ostream& resolveLens0xffff(std::ostream& os, const Value& value,
2147                                                  const ExifData* metadata)
2148     {
2149         try {
2150             long lensID = 0xffff;
2151             long index  = 1   ;
2152 
2153             // #1153
2154             std::string model       = getKeyString("Exif.Image.Model"            ,metadata);
2155             std::string maxAperture = getKeyString("Exif.Photo.MaxApertureValue" ,metadata);
2156 
2157             std::string F1_8        = "434/256" ;
2158             Exiv2::StringSet maxApertures;
2159                              maxApertures.insert( "926/256") ; // F3.5
2160                              maxApertures.insert("1024/256") ; // F4
2161                         	 maxApertures.insert("1110/256") ; // F4.5
2162                         	 maxApertures.insert("1188/256") ; // F5
2163                         	 maxApertures.insert("1272/256") ; // F5.6
2164 
2165             if ( model == "ILCE-6000" && maxAperture == F1_8 ) try {
2166                 long    focalLength = getKeyLong  ("Exif.Photo.FocalLength"      ,metadata);
2167                 long    focalL35mm  = getKeyLong  ("Exif.Photo.FocalLengthIn35mmFilm",metadata);
2168                 long    focalRatio  = (focalL35mm*100)/focalLength;
2169                 if ( inRange(focalRatio,145,155) ) index = 2 ;
2170             } catch (...) {}
2171 
2172             if ( model == "ILCE-6000" && maxApertures.find(maxAperture) != maxApertures.end() ) try {
2173                 long    focalLength = getKeyLong  ("Exif.Photo.FocalLength"      ,metadata);
2174                 long    focalL35mm  = getKeyLong  ("Exif.Photo.FocalLengthIn35mmFilm",metadata);
2175                 long    focalRatio  = (focalL35mm*100)/focalLength;
2176                 if ( inRange(focalRatio,145,155) ) index = 3 ;
2177             } catch (...) {}
2178 
2179             if ( index > 0 ) return resolvedLens(os,lensID,index);
2180         } catch (...) {}
2181 
2182         return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
2183     }
2184 
2185     struct LensIdFct {
2186        long     id_;                           //!< Lens id
2187        PrintFct fct_;                          //!< Pretty-print function
2188        //! Comparison operator for find template
operator ==Exiv2::Internal::LensIdFct2189        bool operator==(long id) const { return id_ == id; }
2190     };
2191 
2192     //! List of lens ids which require special treatment from printMinoltaSonyLensID
2193     const LensIdFct lensIdFct[] = {
2194        {   0x001c, resolveLens0x1c },
2195        {   0x0029, resolveLens0x29 },
2196        {   0x0034, resolveLens0x34 },
2197        {   0x0080, resolveLens0x80 },
2198        {   0x00ff, resolveLens0xff },
2199        {   0xffff, resolveLens0xffff },
2200 //     {   0x00ff, resolveLensTypeUsingExiftool }, // was used for debugging
2201     };
2202     // #1145 end - respect lenses with shared LensID
2203     // ----------------------------------------------------------------------
2204 
printMinoltaSonyLensID(std::ostream & os,const Value & value,const ExifData * metadata)2205     std::ostream& printMinoltaSonyLensID(std::ostream& os, const Value& value, const ExifData* metadata)
2206     {
2207 		// #1034
2208 		const std::string undefined("undefined") ;
2209 		const std::string minolta  ("minolta");
2210 		const std::string sony     ("sony");
2211 		if ( Internal::readExiv2Config(minolta,value.toString(),undefined) != undefined ) {
2212 			return os << Internal::readExiv2Config(minolta,value.toString(),undefined);
2213 		}
2214 		if ( Internal::readExiv2Config(sony,value.toString(),undefined) != undefined ) {
2215 			return os << Internal::readExiv2Config(sony,value.toString(),undefined);
2216 		}
2217 
2218         // #1145 - respect lenses with shared LensID
2219         unsigned long    index = value.toLong();
2220         const LensIdFct* lif   = find(lensIdFct,index);
2221         if ( lif && metadata ) {
2222             if ( lif->fct_ )
2223                 return lif->fct_(os, value, metadata);
2224         }
2225 
2226         return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata);
2227     }
2228 
2229     // ----------------------------------------------------------------------------------------------------
2230 
2231     //! Lookup table to translate Minolta A100 and all other Sony Alpha camera color mode values to readable labels
2232     extern const TagDetails minoltaSonyColorMode[] = {
2233         { 0,   N_("Standard")            },
2234         { 1,   N_("Vivid Color")         },
2235         { 2,   N_("Portrait")            },
2236         { 3,   N_("Landscape")           },
2237         { 4,   N_("Sunset")              },
2238         { 5,   N_("Night View/Portrait") },
2239         { 6,   N_("Black & White")       },
2240         { 7,   N_("AdobeRGB")            },
2241         { 12,  N_("Neutral")             },
2242         { 100, N_("Neutral")             },
2243         { 101, N_("Clear")               },
2244         { 102, N_("Deep")                },
2245         { 103, N_("Light")               },
2246         { 104, N_("Night View")          },
2247         { 105, N_("Autumn Leaves")       }
2248     };
2249 
printMinoltaSonyColorMode(std::ostream & os,const Value & value,const ExifData * metadata)2250     std::ostream& printMinoltaSonyColorMode(std::ostream& os, const Value& value, const ExifData* metadata)
2251     {
2252         return EXV_PRINT_TAG(minoltaSonyColorMode)(os, value, metadata);
2253     }
2254 
2255     // ----------------------------------------------------------------------------------------------------
2256 
2257     //! Lookup table to translate Minolta/Sony bool function values to readable labels
2258     extern const TagDetails minoltaSonyBoolFunction[] = {
2259         { 0, N_("Off") },
2260         { 1, N_("On")  }
2261     };
2262 
printMinoltaSonyBoolValue(std::ostream & os,const Value & value,const ExifData * metadata)2263     std::ostream& printMinoltaSonyBoolValue(std::ostream& os, const Value& value, const ExifData* metadata)
2264     {
2265         return EXV_PRINT_TAG(minoltaSonyBoolFunction)(os, value, metadata);
2266     }
2267 
2268     // ----------------------------------------------------------------------------------------------------
2269 
2270     //! Lookup table to translate Minolta/Sony bool inverse function values to readable labels
2271     extern const TagDetails minoltaSonyBoolInverseFunction[] = {
2272         { 0, N_("On")  },
2273         { 1, N_("Off") }
2274     };
2275 
printMinoltaSonyBoolInverseValue(std::ostream & os,const Value & value,const ExifData * metadata)2276     std::ostream& printMinoltaSonyBoolInverseValue(std::ostream& os, const Value& value, const ExifData* metadata)
2277     {
2278         return EXV_PRINT_TAG(minoltaSonyBoolInverseFunction)(os, value, metadata);
2279     }
2280 
2281     // ----------------------------------------------------------------------------------------------------
2282 
2283     //! Lookup table to translate Sony camera settings focus mode values to readable labels
2284     extern const TagDetails minoltaSonyAFAreaMode[] = {
2285         { 0, N_("Wide")  },
2286         { 1, N_("Local") },
2287         { 2, N_("Spot")  }
2288     };
2289 
printMinoltaSonyAFAreaMode(std::ostream & os,const Value & value,const ExifData * metadata)2290     std::ostream& printMinoltaSonyAFAreaMode(std::ostream& os, const Value& value, const ExifData* metadata)
2291     {
2292         return EXV_PRINT_TAG(minoltaSonyAFAreaMode)(os, value, metadata);
2293     }
2294 
2295     // ----------------------------------------------------------------------------------------------------
2296 
2297     //! Lookup table to translate Sony camera settings Local AF Area Point values to readable labels
2298     extern const TagDetails minoltaSonyLocalAFAreaPoint[] = {
2299         { 1,  N_("Center")       },
2300         { 2,  N_("Top")          },
2301         { 3,  N_("Top-Right")    },
2302         { 4,  N_("Right")        },
2303         { 5,  N_("Bottom-Right") },
2304         { 6,  N_("Bottom")       },
2305         { 7,  N_("Bottom-Left")  },
2306         { 8,  N_("Left")         },
2307         { 9,  N_("Top-Left")     },
2308         { 10, N_("Far-Right")    },
2309         { 11, N_("Far-Left")     }
2310     };
2311 
printMinoltaSonyLocalAFAreaPoint(std::ostream & os,const Value & value,const ExifData * metadata)2312     std::ostream& printMinoltaSonyLocalAFAreaPoint(std::ostream& os, const Value& value, const ExifData* metadata)
2313     {
2314         return EXV_PRINT_TAG(minoltaSonyLocalAFAreaPoint)(os, value, metadata);
2315     }
2316 
2317     // ----------------------------------------------------------------------------------------------------
2318 
2319     //! Lookup table to translate Sony camera settings dynamic range optimizer mode values to readable labels
2320     extern const TagDetails minoltaSonyDynamicRangeOptimizerMode[] = {
2321         { 0,    N_("Off")            },
2322         { 1,    N_("Standard")       },
2323         { 2,    N_("Advanced Auto")  },
2324         { 3,    N_("Advanced Level") },
2325         { 4097, N_("Auto")           }
2326     };
2327 
printMinoltaSonyDynamicRangeOptimizerMode(std::ostream & os,const Value & value,const ExifData * metadata)2328     std::ostream& printMinoltaSonyDynamicRangeOptimizerMode(std::ostream& os, const Value& value, const ExifData* metadata)
2329     {
2330         return EXV_PRINT_TAG(minoltaSonyDynamicRangeOptimizerMode)(os, value, metadata);
2331     }
2332 
2333     // ----------------------------------------------------------------------------------------------------
2334 
2335     //! Lookup table to translate Sony camera settings priority setup shutter release values to readable labels
2336     extern const TagDetails minoltaSonyPrioritySetupShutterRelease[] = {
2337         { 0, N_("AF")      },
2338         { 1, N_("Release") }
2339     };
2340 
printMinoltaSonyPrioritySetupShutterRelease(std::ostream & os,const Value & value,const ExifData * metadata)2341     std::ostream& printMinoltaSonyPrioritySetupShutterRelease(std::ostream& os, const Value& value, const ExifData* metadata)
2342     {
2343         return EXV_PRINT_TAG(minoltaSonyPrioritySetupShutterRelease)(os, value, metadata);
2344     }
2345 
2346     // ----------------------------------------------------------------------------------------------------
2347 
2348     //! Lookup table to translate Sony camera settings quality values to readable labels
2349     extern const TagDetails minoltaSonyQualityCs[] = {
2350         { 0,   N_("RAW")        },
2351         { 2,   N_("CRAW")       },
2352         { 16,  N_("Extra Fine") },
2353         { 32,  N_("Fine")       },
2354         { 34,  N_("RAW+JPEG")   },
2355         { 35,  N_("CRAW+JPEG")  },
2356         { 48,  N_("Standard")   }
2357     };
2358 
printMinoltaSonyQualityCs(std::ostream & os,const Value & value,const ExifData * metadata)2359     std::ostream& printMinoltaSonyQualityCs(std::ostream& os, const Value& value, const ExifData* metadata)
2360     {
2361         return EXV_PRINT_TAG(minoltaSonyQualityCs)(os, value, metadata);
2362     }
2363 
2364     // ----------------------------------------------------------------------------------------------------
2365 
2366     //! Lookup table to translate Sony camera settings rotation values to readable labels
2367     extern const TagDetails minoltaSonyRotation[] = {
2368         { 0, N_("Horizontal (normal)") },
2369         { 1, N_("Rotate 90 CW")        },
2370         { 2, N_("Rotate 270 CW")       }
2371     };
2372 
printMinoltaSonyRotation(std::ostream & os,const Value & value,const ExifData * metadata)2373     std::ostream& printMinoltaSonyRotation(std::ostream& os, const Value& value, const ExifData* metadata)
2374     {
2375         return EXV_PRINT_TAG(minoltaSonyRotation)(os, value, metadata);
2376     }
2377 
2378     // ----------------------------------------------------------------------------------------------------
2379 
2380     //! Lookup table to translate Minolta/Sony scene mode values to readable labels
2381     extern const TagDetails minoltaSonySceneMode[] = {
2382         { 0,  N_("Standard")            },
2383         { 1,  N_("Portrait")            },
2384         { 2,  N_("Text")                },
2385         { 3,  N_("Night Scene")         },
2386         { 4,  N_("Sunset")              },
2387         { 5,  N_("Sports")              },
2388         { 6,  N_("Landscape")           },
2389         { 7,  N_("Night Portrait")      },
2390         { 8,  N_("Macro")               },
2391         { 9,  N_("Super Macro")         },
2392         { 16, N_("Auto")                },
2393         { 17, N_("Night View/Portrait") }
2394     };
2395 
printMinoltaSonySceneMode(std::ostream & os,const Value & value,const ExifData * metadata)2396     std::ostream& printMinoltaSonySceneMode(std::ostream& os, const Value& value, const ExifData* metadata)
2397     {
2398         return EXV_PRINT_TAG(minoltaSonySceneMode)(os, value, metadata);
2399     }
2400 
2401     // ----------------------------------------------------------------------------------------------------
2402 
2403     //! Lookup table to translate Sony/Minolta image quality values to readable labels
2404     extern const TagDetails minoltaSonyImageQuality[] = {
2405         { 0, N_("Raw")                   },
2406         { 1, N_("Super Fine")            },
2407         { 2, N_("Fine")                  },
2408         { 3, N_("Standard")              },
2409         { 4, N_("Economy")               },
2410         { 5, N_("Extra Fine")            },
2411         { 6, N_("Raw + JPEG")            },
2412         { 7, N_("Compressed Raw")        },
2413         { 8, N_("Compressed Raw + JPEG") }
2414     };
2415 
printMinoltaSonyImageQuality(std::ostream & os,const Value & value,const ExifData * metadata)2416     std::ostream& printMinoltaSonyImageQuality(std::ostream& os, const Value& value, const ExifData* metadata)
2417     {
2418         return EXV_PRINT_TAG(minoltaSonyImageQuality)(os, value, metadata);
2419     }
2420 
2421     // ----------------------------------------------------------------------------------------------------
2422 
2423     //! Lookup table to translate Sony/Minolta teleconverter model values to readable labels
2424     extern const TagDetails minoltaSonyTeleconverterModel[] = {
2425         { 0x00, N_("None")                                },
2426         { 0x04, N_("Minolta/Sony AF 1.4x APO (D) (0x04)") },
2427         { 0x05, N_("Minolta/Sony AF 2x APO (D) (0x05)")   },
2428         { 0x48, N_("Minolta/Sony AF 2x APO (D)")          },
2429         { 0x50, N_("Minolta AF 2x APO II")                },
2430         { 0x60, N_("Minolta AF 2x APO")                   },
2431         { 0x88, N_("Minolta/Sony AF 1.4x APO (D)")        },
2432         { 0x90, N_("Minolta AF 1.4x APO II")              },
2433         { 0xa0, N_("Minolta AF 1.4x APO")                 }
2434     };
2435 
printMinoltaSonyTeleconverterModel(std::ostream & os,const Value & value,const ExifData * metadata)2436     std::ostream& printMinoltaSonyTeleconverterModel(std::ostream& os, const Value& value, const ExifData* metadata)
2437     {
2438         return EXV_PRINT_TAG(minoltaSonyTeleconverterModel)(os, value, metadata);
2439     }
2440 
2441     // ----------------------------------------------------------------------------------------------------
2442 
2443     //! Lookup table to translate Sony/Minolta Std camera settings white balance values to readable labels
2444     extern const TagDetails minoltaSonyWhiteBalanceStd[] = {
2445         { 0x00,  N_("Auto")                           },
2446         { 0x01,  N_("Color Temperature/Color Filter") },
2447         { 0x10,  N_("Daylight")                       },
2448         { 0x20,  N_("Cloudy")                         },
2449         { 0x30,  N_("Shade")                          },
2450         { 0x40,  N_("Tungsten")                       },
2451         { 0x50,  N_("Flash")                          },
2452         { 0x60,  N_("Fluorescent")                    },
2453         { 0x70,  N_("Custom")                         }
2454     };
2455 
printMinoltaSonyWhiteBalanceStd(std::ostream & os,const Value & value,const ExifData * metadata)2456     std::ostream& printMinoltaSonyWhiteBalanceStd(std::ostream& os, const Value& value, const ExifData* metadata)
2457     {
2458         return EXV_PRINT_TAG(minoltaSonyWhiteBalanceStd)(os, value, metadata);
2459     }
2460 
2461     //! Lookup table to translate Sony/Minolta zone matching values to readable labels
2462     extern const TagDetails minoltaSonyZoneMatching[] = {
2463         { 0, N_("ISO Setting Used") },
2464         { 1, N_("High Key") },
2465         { 2, N_("Low Key")  }
2466     };
2467 
printMinoltaSonyZoneMatching(std::ostream & os,const Value & value,const ExifData * metadata)2468     std::ostream& printMinoltaSonyZoneMatching(std::ostream& os, const Value& value, const ExifData* metadata)
2469     {
2470         return EXV_PRINT_TAG(minoltaSonyZoneMatching)(os, value, metadata);
2471     }
2472 
printMinoltaSonyFlashExposureComp(std::ostream & os,const Value & value,const ExifData *)2473     std::ostream& printMinoltaSonyFlashExposureComp(std::ostream& os, const Value& value, const ExifData*)
2474     {
2475         std::ios::fmtflags f( os.flags() );
2476         if (value.count() != 1 || value.typeId() != signedRational) {
2477             return os << "(" << value << ")";
2478         }
2479         os << std::fixed << std::setprecision(2) << value.toFloat(0) << " EV";
2480         os.flags(f);
2481         return os;
2482     }
2483 
2484 }}                                      // namespace Internal, Exiv2
2485