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

Gilles Caulier caulier.gilles at kdemail.net
Thu Mar 2 07:18:58 GMT 2006


Le Jeudi 2 Mars 2006 02:29, vous avez écrit :
> 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()
>     }
>

ok. I have used this way. All tags value are displayed nicely now.  thanks 
(:=))

> 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).

right. I will take a look.

Ok, we have improved the "tag values" output. Now, still the problem to do an 
user friendly output of "tag names" like :

DateTimeOriginal ==> Image timestamp.

In ExifWidget::decodeMetadata() my implementation is  :

...

for (Exiv2::ExifData::iterator md = exifData.begin(); md != exifData.end(); 
++md)
        {
            QString key   = QString::fromLocal8Bit(md->key().c_str());

            // Decode the tag value with a user friendly output.
            std::ostringstream os;
            os << *md;
            QString value = QString::fromLocal8Bit(os.str().c_str());

            // We apply a filter to get only standard Exif tags, not maker 
notes.
            if (stdExifFilter.contains(key.section(".", 1, 1)))
                metaDataMap.insert(key, value);
        }

There is a way to make it automaticly using Exiv2 ?

Gilles



More information about the Digikam-users mailing list