[Digikam-users] [Digikam-devel] Image Metadata extraction : implementation progress...

Andreas Huggel ahuggel at gmx.net
Thu Mar 2 01:29:58 GMT 2006

Caulier Gilles wrote:

>And another question : how to get a more user friendly value of tag. The Exif 
>data are sometime uninterpreted number values instead of strings. EG for a 
>Nikon Camera there is a FlashpixVersion string which ist shown as 48 49 48 48 
>probably meaning 1.00.   Other things like exposure time (and many more) are 
>displayed as a fraction (10/200) instead of a clearer value (1/20). This kind 
>of interpretation problems happen in many other EXIF tags as well.
>There is a way in Exiv2 to solve it or i need to polish the Exiv2 output in 
>digiKam ?
    Exiv2::ExifData::const_iterator end = exifData.end();
    for (Exiv2::ExifData::const_iterator md = exifData.begin(); md != 
end; ++md) {
        std::ostringstream os;
        os << *md;
        // then work with os.str()

This provides the more readable tag values, it will take care of many 
but not all of these issues, because not all tags have a 
"pretty-print-function" and in some cases you may want more logic e.g. 
to choose a tag depending on its availability. E.g., for Exposure time 
try the ExposureTime tag, if it doesn't exist, try ShutterSpeedValue.

If a pretty-print-function is missing, let me know, it can easily be 
added. All that is needed is a function which is registered in the tag 
lookup table. For example, look for print0x0112 in tags.[ch]pp.

For sample code to print a summary of the Exif data, see 
Print::printSummary() in actions.cpp (used in the exiv2 utility).


More information about the Digikam-users mailing list