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

Andreas Huggel ahuggel at gmx.net
Tue Feb 28 15:51:05 GMT 2006


Hi,

Thanks for using Exiv2!

On Tuesday 28 February 2006 19:39, Gilles Caulier wrote:
> Le Mardi 28 Février 2006 11:09, Gilles Caulier a écrit :
> > Hi all digiKam users/team,
> >
> > Like you have seen last week, I have started a new implementation of
> > metadata viewer using libExiv2 instead the current Exif viewer using
> > libkexif.
> >
> > A fresh screenshot can be seen here :
> >
> > http://digikam3rdparty.free.fr/Screenshots/digikam0.9.0-alpha6.png

Nice pictures. I noticed that the metadata is shown as plain values as opposed 
to human readable strings, e.g., "ResolutionUnit 2" as opposed to 
"ResolutionUnit inch". Can the user change that with the "Level of detail" 
setting ("Simple" sounds like not everything is shown though)? Especially for 
makernotes, the more readable expressions might be more useful than plain 
values. You can get these easily by using the output operator for Exifdatum.

>
> Current Exiv2 problems (correct me if i'm wrong (:=))) :
>
> - The tags descriptions exist in Exiv2 but I can access it easily in my
> implementation...

Assuming this should read "can _not_ access it easily" and refers to the 
commented code in eg, ExifWidget::getTagDescription(): What about smth like 
this (ignoring the conversions from and to QString):

  try {
      Exiv2::ExifKey ek(key); 
      return Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId());
  }
  catch (Exiv2::AnyError& e) {
      // not an Exif key
  }

Admittedly, this is still not really nice. And yes, it doesn't use gettext 
yet.

Thanks for encouraging contributions to Exiv2. i18n support is a particularly 
good candidate for someone who knows or would like to learn gettext.

>
> Here we are a patch against current digikam from svn 'trunk' branch :
>
> http://digikam3rdparty.free.fr/misc.tarballs/metadata.diff

In DMetaLoader::loadWithExiv2()

+        Exiv2::ExifData& exifData = image->exifData();
              ----------^
Reference to prevent copying (and similar for Iptc).

+    catch( Exiv2::AnyError &e )
         ----------^^^ Baseclass in case future versions have more error 
classes
+    {
+        kdDebug() << "Cannot load metadata using Exiv2 (" << e << ")" << 
endl;
 If you wanted the error message instead of just a code ------^
+        return false;
+    }

Further down, there is this remark:

+    // We trying to load exif data using likexif from THM file (thumbnail) if 
exist,
     // especially provided by recent USM camera.

When reading from Canon CRW files, it might be interesting to check if there 
is a correspoding THM file and use that instead. (At least some) Canon 
cameras write such files together with CRW files and they contain the 
complete Exif metadata instead of only a small subset, like the CRW file. 
Exiv2 can read Canon THM files, they are just small Jpegs.

>
> Gilles Caulier

Regards,
Andreas



More information about the Digikam-users mailing list