In order to translate some Exif tag values the pretty-print function
needs access to other Exif tags. If a tag is translated the usual way,
this is not the case:
// pretty-printing function only sees the tag to be printed
std::cout << metadatum << "\n";
std::string val = metadatum.print();
Sample result: Exif.CanonCs.LensType 131
This code continues to work. In addition, I've enhanced the interface
so that pretty-print functions can see all Exif tags. Applications can
now change the way they obtain the translated values and get a better
translation:
// pretty-printing function can refer to all Exif tags
metadatum.write(std::cout, &exifData) << "\n";
std::string val = metadatum.print(&exifData);
Sample result: Exif.CanonCs.LensType Sigma 17-70mm f/2.8-4.5 DC Macro
Currently, the pretty-printing functions to decode lens names for
images from Canon and Nikon cameras use this(*) but more will be added
soon.
This should be a small change and I recommend that all applications
apply it globally and use the old method only if really necessary. As
an sample, these are the changes that were needed in the exiv2 tool:
http://dev.robotbattle.com/cgi-bin/viewvc.cgi/exiv2/trunk/src/actions.cpp?r1=163\
2&r2=1633
(*) Canon has some ambiguous lens types which can be resolved this way
and some Nikon cameras encrypt the lens info and need the shutter
count and serial number from other tags as key for decryption.
Andreas