Bug 185805 - digikam 0.10.0-rc2 fails to save keyword hierarchy in IPTC and XMP tags
Summary: digikam 0.10.0-rc2 fails to save keyword hierarchy in IPTC and XMP tags
Status: RESOLVED NOT A BUG
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Xmp (show other bugs)
Version: 0.10.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-28 16:11 UTC by Jan Ott
Modified: 2017-08-13 07:29 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.10.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Ott 2009-02-28 16:11:25 UTC
Version:            0.10.0-rc2 (using KDE 4.2.0)
OS:                Linux
Installed from:    Ubuntu Packages

digikam 0.10.0-rc2, KDE 4.2, Kubuntu 8.1 Intrepid

Example keyword hierarchy: 1st level: food, 2nd level: fruit, 3rd level: banana

When I try to assign the keyword "banana" and its hierarchy levels to an image by checking "banana" in the hierarchy tree, only the keyword "banana" is saved to IPTC and XMP tags.

When I check all the three words in the hierarchy tree, they are saved as single words to IPTC and XMP:

food
fruit
banana

and not as slash-separated string "food/fruit/banana" showing the hierarchy like it used to be in Digikam 0.9.x.

Is this a configuration problem, a limitation or a bug?

Thanks to digikam developers for their great work!

Jan
Comment 1 caulier.gilles 2009-02-28 16:21:29 UTC
This entry is invalid. 

IPTC and XMP standard keywords tags save... keywords only.

But digiKam tags hierarchy is always saved in metadata, not in IPTC but in a dedicated digiKam XMP namespace like this:

http://www.flickr.com/photos/digikam/3316581390/sizes/o/in/pool-817639@N22/

Of course just set on the right option in digiKam metadata settings panel.

Gilles Caulier
Comment 2 krienke 2009-03-02 10:17:52 UTC
Hello,

I also use digikam 0.10 rc2. xmp ist enabled, In digikams metadata display sidetab for XMP there is no "digikam" section like in the screenshot Gilles posted on flickr from above.  The only sections I have there are Dublin Core, Exif, Adobe Photoshop, Tiff and Basic. 

Also there is no "Tags List" entry like in the screenshot on flickr. Tags are stored in a section called "subject"  but without complete path there.

Is there a way to check if the complete metadatapath of tags  really has been stored somewhere in the files, using eg exiv2? A simple exiv2 -px <file.jpg> does not reveal any information not already included in the XMP sidetab metadata display in digikam. 

Does this perhaps depend on certain library versions? I have these ones here according to digikams help output:

digiKam version 0.10.0-rc2
Exiv2 kann nicht in JP2 speichern: Keine
Exiv2 kann nicht in JPEG speichern: Ja
Exiv2 kann nicht in PNG speichern: Keine
Exiv2 kann nicht in TIFF speichern: Keine
Exiv2 unterstützt XMP-Metadaten: Ja
LibCImg: 129
LibExiv2: 0.17.1
LibJPEG: 62
LibJasper: 1.900.1
LibKDE: 4.2.00 (KDE 4.2.0) "release 102"
LibKExiv2: 0.5.0
LibKdcraw: 0.4.1
LibLCMS: 117
LibPNG: 1.2.31
LibQt: 4.4.3
LibRaw: 0.6.13-Release
LibTIFF: LIBTIFF, Version 3.8.2 Copyright (c) 1988-1996 Sam Leffler Copyright (c) 1991-1996 Silicon Graphics, Inc.
Marble-Widget: 0.7
LibGphoto2: 2.4.3
LibKipi: 0.3.0
Comment 3 caulier.gilles 2009-03-02 10:48:57 UTC
You need to enable full metadata list mode to display TagList XMP tag. Just press on the 2nd button on the top left corner of XMP metadata view.

Tags List is cached by default.

In all case, this XMP tag and only this one is used to save Tag list info. We don't use ITC now, due to severals limitation of IPTC (string size, char encoded to ASCII, etc...)

In case of images come from KDE3 version of digiKam, there is no XMP included. IPTC is used insted to backport tags list. After that, IPTC is never used for that, and XMP is used instead...

Gilles Caulier
Comment 4 krienke 2009-03-02 11:31:19 UTC
I already did press the full info button in xmp sidetab but there is no "Tags List" entry. See the screen shot here:

http://userpages.uni-koblenz.de/~krienke/tmp/digikam/digikam-xmp.jpg

I am not sure if I understood what you said about photos coming from digikam 0.9.   But as far as I understood even then xmp should be used when working with 0.10?

My photos actually come from 0.9.  I just made a small test:

Running  0.10 I created a new tag in digikam and assigned this tag to a photo. However this new tag does appear in the XMP section (see screenshot above) . It does however appear in IPTC.

Is this behaviour correct?  

If you look at the info window in screenshot above. The is one line that seems strange to me. Its written in german. In english this might read like 

digiKam version 0.10.0-rc2
Exiv2 cannot write into  JP2 : None
Exiv2 cannot write into JPEG : Yes     <-----
Exiv2 cannot write  into PNG : None 
Exiv2 cannot writeinto  TIFF : None
Exiv2 supports  XMP-Metadata: Yes
LibCImg: 129
LibExiv2: 0.17.1
LibJPEG: 62
....

Does this line mean that "my" exiv2 cannot store any metadata in jpg files? Perhaps this is the cause for problems?

Thanks
Rainer
Comment 5 caulier.gilles 2009-03-02 13:06:24 UTC
Ah, this is a bug from libkexiv2 not Exiv2, where a stupid test faild. It's already fixed since few week. Please update this library (I use 0.6.0 here)

Gilles Caulier
Comment 6 caulier.gilles 2009-03-04 10:03:40 UTC
// -----------------------------------------------------------------

Am Montag 02 März 2009 13:06:25 schrieb Gilles Caulier:

I downloaded libkexiv2 from svn
(svn://anonsvn.kde.org/home/kde/branches/KDE/4.2/kdegraphics/libs), compiled
and installed it.  The installed  lib is now libkexiv2.so.7.2.0.  I also
recompiled digikam from svn but still no change. The Metadata sidetab shows no
"TagList" entry and still no digikam section.

I can see however that in digikams component info it still shows that
libkexiv2 is Version 0.5.0. However as described above I have 7.2.0 installed
and verified by ldd that digikam really uses this lib:

[krienke@bliss:~] 1003 > ldd /usr/bin/digikam|grep libkexiv2
       libkexiv2.so.7 => /usr/lib/libkexiv2.so.7 (0xb7819000)

Did i perhaps download the wrong libkexiv lib from svn?

Thanks
Rainer

// -----------------------------------------------------------------

Rainer, please post to bugzilla not mailing list to not break the story

Gilles
Comment 7 caulier.gilles 2009-03-04 10:09:27 UTC
Rainer,

To be sure, go to libkexiv2 source code and look version info from libkexiv2/libkexiv2/version.h. You must see 0.6.0 if you have checkout code from svn trunk.

When you have recompiled digiKam & co, are you remove CMakeCache.txt file on root source code folder to be sure than new libkexiv2 will be used ?

Gilles Caulier
Comment 8 krienke 2009-03-04 10:30:17 UTC
Ok. version.h says 0.5.0 so thats the problem. Can anyone tell where to find the latest version in svn for libkexiv2?

Thanks
Rainer

// --- 
Sorry for only posting to digikam-devel. Thought that if there a BugID inside the mail subject this would be forwarded to BKO as well.
Comment 9 caulier.gilles 2009-03-04 10:34:41 UTC
look here :

http://websvn.kde.org/trunk/KDE/kdegraphics/libs/libkexiv2/

Gilles
Comment 10 krienke 2009-03-04 13:37:48 UTC
Sorry still having problems.  I am struggling with cmake I guess. I did this:
mkdir svn
cd svn
svn -N co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdegraphics
cd kdegraphics
svn up libs
svn up cmake

Now there is libs/libkexiv2 as well as eg libkdcraw and others
Next in kdegraphics I did:
cmake .
make

Then the code eg for libksane, libkdcraw, ... is compiled but unfortunately not the code for libkexiv2. Even libkexiv2/version,h does only exist as version.
h.cmake. It seems that cmake does not process libkexiv2 correctly but I do not see any error. 

Any idea what might be wrong?

Thanks
Rainer
Comment 11 caulier.gilles 2009-03-04 14:26:42 UTC
Give me the trace when you run "cmake ."

Gilles
Comment 12 krienke 2009-03-04 15:45:03 UTC
hello,

preparing the output you requested I saw the problem. I had exiv2 0.17 installed but minimal requirement was 0.18. After installing 0.18 I could compile libkexiv2 from svn. digikam now says it has libkexiv2 0.6.0. 

When inserting new photos to digikam and adding at least one tag I now can see the digikam section in xmp metadata sidetab with the "TagList" entry.

However this is only true for photos I *add* to digikam. The photos that already existed still do not have a "TagList" in XMP Metadata display. I tried a sync database with photos, but this does not help. 

How can I "update" the metadata of all my photos (about 6000) so they get the correct "TagList" metadata value from the tags set in digikams database?

Thanks
Rainer
Comment 13 caulier.gilles 2009-03-04 15:59:40 UTC
Here it work. Just tested using 3 jpeg images wher tags are assigned. I remove all XMP data to be sure and i run "Album/Synchronize images with DB" to run over current album. XMP is regenerated and Tags List appears.

If you want to process whole collections, use "Tools/Synchronize all images with DB"

Gilles Caulier
Comment 14 caulier.gilles 2009-03-04 16:00:11 UTC
Here it work. Just tested using 3 jpeg images wher etags are assigned. I remove all XMP data to be sure and i run "Album/Synchronize images with DB" to run over current album. XMP is regenerated and Tags List appears.

If you want to process whole collections, use "Tools/Synchronize all images with DB"

Gilles Caulier
Comment 15 krienke 2009-03-05 08:54:06 UTC
Hi Gilles,
works great if there are no XMP metadata in photos. I did not remove them before I tried. So when xmp metadata  are already in place they are not updated with the special "TagsList" tag in digikam namespace when doing a "Album/Synchronize images with DB".

Wouldn't it be a good idea to add the 2TagsList" entry to XMP if there are already XMP metadata in a file but exactly the "TagsList" tag is missing?

Thnaks
Rainer
Comment 16 caulier.gilles 2009-03-05 09:18:51 UTC
>So when xmp metadata  are already in place they are not updated
>with the special "TagsList" tag in digikam namespace when doing a
>"Album/Synchronize images with DB".

So, i cannot reproduce this problem too.

- I take JPEG image with XMP data. tags are already assigned to this picture and recorded to XMP Tags List.
- I unset "Save image tags as keywords tag" option from metadata settings panel.
- I assign 2 new tags to the image. Tags List is not updated.
- I set on "Save image tags as keywords tag" option from metadata settings panel.
- I sync Album content with DB : Tags List is updated.

The same is true if image as already XMP metadata without Tag List entry. In all cases, Tags List is created or updated properly

Gilles Caulier
Comment 17 krienke 2009-03-05 11:11:09 UTC
What you descibed works fine for me as well for new, added photos. The effect I observer is different and perhaps only happens for old photos processed with 0.10 and broken likkexiv2.  Take this photo as a demo: 

http://userpages.uni-koblenz.de/~krienke/tmp/digikam/dsc_5703.jpg


This photo has XMP metadata that was added by digikam 0.10 with broken libkexiv2 (version 0.5.0). It has keywords in XMP but is does not have Xmp.digikam.TagsList entry. 

Now with libkexiv2 0.6.0 adding a new tag to the list of tags of such a photo in digikam 0.10 is not reflected in the files XMP metadata (Xmp.dc.subject) and  Xmp.digikam.TagsList will *not* be added even when "Album/Synchronize images with DB" is performed. 

Xmp.digikam.TagsList is only added to this photo if I delete XMP completely and then do "Album/Synchronize images with DB".  However I think it would be useful to generally add Xmp.digikam.TagsList to XMP metadata if its not yet there.

Rainer
Comment 18 caulier.gilles 2009-03-05 12:04:28 UTC
Ah, yes. now, i can reproduce...

digikam(7138) Digikam::DMetadata::setImageComment: "/mnt/data/photo/test/batch queue manager/dsc_5703.jpg"  ==> Comment:  ""
digikam(7138) Digikam::DMetadata::setImageRating: Rating value to write is out of range!
digikam(7138) KExiv2Iface::KExiv2::setIptcKeywords: /mnt/data/photo/test/batch queue manager/dsc_5703.jpg  ==> Iptc Keywords: Fluesse+Baeche,Winterlich,St.Barbara
digikam(7138) KExiv2Iface::KExiv2::getXmpTagStringSeq: XMP String Seq ( Xmp.dc.creator ):  ("Rainer Krienke")
digikam(7138) Digikam::DMetadata::setIptcTag: "/mnt/data/photo/test/batch queue manager/dsc_5703.jpg"  ==>  Author :  ""
digikam(7138) Digikam::DMetadata::setIptcTag: "/mnt/data/photo/test/batch queue manager/dsc_5703.jpg"  ==>  Author Title :  ""
digikam(7138) KExiv2Iface::KExiv2::setXmpTagStringLangAlt: "Rainer Krienke"
digikam(7138) KExiv2Iface::KExiv2::setXmpTagStringLangAlt: "Rainer Krienke"
digikam(7138) Digikam::DMetadata::setIptcTag: "/mnt/data/photo/test/batch queue manager/dsc_5703.jpg"  ==>  Credit :  ""
digikam(7138) Digikam::DMetadata::setIptcTag: "/mnt/data/photo/test/batch queue manager/dsc_5703.jpg"  ==>  Source :  ""
digikam(7138) Digikam::DMetadata::setIptcTag: "/mnt/data/photo/test/batch queue manager/dsc_5703.jpg"  ==>  Copyright :  ""
digikam(7138) KExiv2Iface::KExiv2::save: File Extension:  "jpg"  is supported for writing mode
Error: Directory NikonPreview with 2020 entries considered invalid; not read.
Error: Directory NikonPreview with 2020 entries considered invalid; not read.
XMP Toolkit error 102: Composite nodes can't have values
Error: Failed to encode XMP metadata.

This last line is the problem. Investiguations in progress...

Gilles
Comment 19 caulier.gilles 2009-03-05 13:18:41 UTC
Ok, I find the problem.

Your XMP metadata are corrupted (wht exactly??? i don't know), i have identified which tags exactly.

Go to Image/Metadata/Edit XMP. Select "Credits" page are remove "Credits" and "Source" tags. Now you can sync image with DB.

Gilles
Comment 20 krienke 2009-03-05 13:36:51 UTC
Thanks a lot Gilles,

I now know how to get things straight.

Have a nice day.
Rainer
Comment 21 Jonas 2009-04-14 13:49:13 UTC
After making an update to the final version of digikam 0.10 (at the moment 	0.10.0 (KDE 4.2.2 (KDE 4.2.2) "release 112", KDE:KDE4:Factory:Desktop / openSUSE_11.1)) and adding some pictures I realized some incorrectness. Wrong keywords are saved in digikam DB, XMP or IPTC.

If I add some keywords to my pictures (e.g. a, b) and try to remove one of them (b) an other keyword (a) is removed so my picture contains the keyword b instead of a in digikam DB but both are in XMP.

And like discussed above no hierarchy is saved in the images. I removed the XMP and sync with the DB but I did not get any hierarchy. So if the XMP is corrupted, it is generated by digikam.
Comment 22 caulier.gilles 2009-04-14 13:57:53 UTC
digiKam tags hierarchy is saved in a dedicated XMP namespace. Look here for example :

http://farm4.static.flickr.com/3309/3440772787_b8a32c5bdf_o.png

Gilles Caulier
Comment 23 Jonas 2009-04-14 14:20:47 UTC
Ok, after an update to the svn version of libkexiv2 all works fine. The latest version of libkexiv2 in SuSE factory repositories was 0.5 (4.2.2-84.17) with the mentioned bug ;)