[Digikam-devel] [Bug 277429] Write out face rectangles to XMP file

Gilles Caulier caulier.gilles at gmail.com
Mon Aug 6 13:04:02 BST 2012


https://bugs.kde.org/show_bug.cgi?id=277429

--- Comment #13 from Gilles Caulier <caulier.gilles at gmail.com> ---
Nick,

Some words about DMetadata::getImageFacesMap(). As Marcel said, it's read Face
Tags registered in image metadata to populate digiKam database. It's used here
:

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/database/imagescanner.cpp#L593

ImageScanner class is used when a new items is detected on collection. Whole
image metadata are scanned...

As you can see in this method, there are 3 classes used to manage faces on DB : 

- FaceTags : 

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/database/faces/facetags.h

- FaceTagsEditor : 

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/database/faces/facetagseditor.h

- TagRegion :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/database/core/tagregion.h

Now about future DMetadata::setImageFacesMap(), the complete goal to implement
is not trivial. You need to patch a lots of place in digiKam, including setup
metadata dialog.

- The lead class used to write and update metadata to image and DB, is
MetadatHub

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/digikam/fileaction/metadatahub.h

This class manage the way to update metadata in file accordingly with digiKam
Metadata Setup options set by end users in config dialog :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/utilities/setup/setupmetadata.cpp

.. where a new option need to be add to handle face writing stuff...

But in the first way, you need to write DMetadata::setImageFacesMap(). Do hack
it, i recommend to write a small test command line program as some exist here :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/show/tests

We have already written test program for libkexiv2 (DMetadata is a drivated
class of KExiv2). As your new method will be introduced in digiKam core, you
cannot set this test program in libkexiv2, but you can take inspiration from
existing test program from Kexiv2 here :

https://projects.kde.org/projects/kde/kdegraphics/libs/libkexiv2/repository/revisions/master/show/test

Only after to have finalized DMetadata::setImageFacesMap(), the rest of digiKam
metadata stuff need to be patched.

Gilles Caulier

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Digikam-devel mailing list