[Digikam-devel] About retrieving tags from digikam and tags properties

Gilles Caulier caulier.gilles at gmail.com
Mon Jun 14 05:03:28 BST 2010


2010/6/14 Gabriel Voicu <ping.gabi at gmail.com>:
> Hello everyone,
> I've almost completed the part where I retrieve data (country, city... for
> photos with given coordinates) from Geonames and OSM. Now, the next part
> would be to integrate in gpssync2 UI, a tree view containing tags for every
> image. This would make the user select where will the new resulted data be
> added in digikams tag hierarchy. Michael Hansen told me that the kipi
> interface should be extended.
> Can you give me some directions on how to extend kipi interface to retrieve
> tags from digikam?

To retrieve digiKam tags with a kipi-plugin, just use this way :

http://lxr.kde.org/source/extragear/graphics/kipi-plugins/flickrexport/flickrwindow.cpp#561

You checkout KIPI::ImageInfo from an item using url :

http://lxr.kde.org/source/extragear/graphics/kipi-plugins/flickrexport/flickrwindow.cpp#536

There are attribute list for it. "tags" are digiKam tags as well :

http://lxr.kde.org/source/extragear/graphics/kipi-plugins/flickrexport/flickrwindow.cpp#567

How it work :

digiKam kipi interface include a simple mechanism which can be
extended without to touch libkipi. You can get special attribute from
database here :

http://lxr.kde.org/source/extragear/graphics/digikam/utilities/kipiiface/kipiimageinfo.cpp#125

or set attribute there :

http://lxr.kde.org/source/extragear/graphics/digikam/utilities/kipiiface/kipiimageinfo.cpp#165

To delete an attribute :

http://lxr.kde.org/source/extragear/graphics/digikam/utilities/kipiiface/kipiimageinfo.cpp#236

or clear all :

http://lxr.kde.org/source/extragear/graphics/digikam/utilities/kipiiface/kipiimageinfo.cpp#271

In fact, use the right attribute names to manage it in these methods.
To extend attribute management, it's easy.

No need to touch libkipi.

Gilles Caulier



More information about the Digikam-devel mailing list