Summary: | entring new xmp meta data removes old one from the image file | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Nadav Kavalerchik <nadavkav> |
Component: | Plugin-Generic-MetadataEdit | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ahuggel, julien.lamare |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.2.0 | |
Sentry Crash Report: | |||
Attachments: |
XMP meta data can be edited
unable to edit XMP meta data Metadata Edit XMP Properties panel |
Description
Nadav Kavalerchik
2009-01-25 11:45:38 UTC
KDE : debian experimental packages (KDE 4.1.4) digikam : svn up to date uname -a : Linux juju 2.6.28.1 #1 SMP PREEMPT Thu Jan 22 15:01:42 CET 2009 x86_64 GNU/Linux Create a new jpeg file (with gimp), put it into a collection, edit some xmp like "credit" and "source", apply, edit the same, apply, that's OK. Write something in "copyright" and apply, OK. Then edit something (copyright or other does the same), apply, and the only informations are : === File name: test.jpg (XMP Schema) >>> TIFF Properties <<< Software : Kipi-plugins-0.2.0-rc2 >>> Basic Schema <<< Creator Tool : Kipi-plugins-0.2.0-rc2 === If you don't close the metadata editor, edit one field and all the informations comes back ! In the shell I have this : "XMP Toolkit error 102: Composite nodes can't have values" If I don't use the "copyright" field there is no problem. Thanks Julien. Error come from XMP sdk from Adobe included to Exiv2. Just to be sure, which Exiv2 library you use. Check in digiKam Help/Components Info. Gilles Caulier LibExiv2: 0.18 Julien started digikam from console and got the same error (no matter what fields i use, one or several...same error) XMP Toolkit error 102: Composite nodes can't have values funny, i have two libexiv2 exiv2-4 : ver 0.17.1-1 [unstabe] exiv2-5 : ver 0.18-1 [experimental] on debian sid (updated) Andreas, This is the dialog of XMP editor in action: http://www.flickr.com/photos/digikam/2615087175/sizes/o/ From this panel, when user set Copyright field, this code running: http://lxr.kde.org/source/extragear/graphics/kipi-plugins/metadataedit/xmpcredits.cpp#533 ... to set "Xmp.dc.rights" tag. libkexiv2 method below is called: http://lxr.kde.org/source/KDE/kdegraphics/libs/libkexiv2/libkexiv2/kexiv2xmp.cpp#307 Like you can see, there is nothing special. Or i'm missing something here, especially with Language Alternative properties of this tag ? Gilles Caulier some more info: on some images (jpg) it works fine and on other it does not. (btw, no idea how it worked in the first place?) i am attching two images with some XMP meta data (and probably some more meta, just ignore it) the editable image is with the track and the people and the other one (which does not edit the XMP meta data) is with the tree see what you make of it :-) Created attachment 30602 [details]
XMP meta data can be edited
Created attachment 30603 [details]
unable to edit XMP meta data
SVN commit 916890 by cgilles: move Copyright editor to Contents section use alternative language editor. CCBUG: 181853 M +30 -10 xmpcontent.cpp M +1 -38 xmpcredits.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=916890 Nadav, Julien, Please checkout my commit #916890 and try again... Gilles Caulier Re comment #5: Gilles, I don't see any obvious problem with the code. If the problem remains, it could be helpful to see what the XMP properties are that are being set. -ahu. Nadav, Julien, Can you test my patch using current code from svn... For me the problem is fixed. Gilles Caulier currently, i use a binary from : http://kde42.debian.net/debian/pool/main/d/digikam/ my current version is 0.10.0-beta8 i am just about to upgrade to rc1 i do not have a way to test it (immidiately) since i do not have the svn version ready to compile. Gilles, did you see any difference in the ability to edit XMP data and save it in the images i attached. before and after the fix ? OK for me, it seems to work fine. Thanks for the patch Julien Andreas, I can't touch Nadav image posted in #8: http://bugs.kde.org/attachment.cgi?id=30603 When i try to add XMP Headline tag, Adobe XMP toolkit said : "XMP Toolkit error 102: Composite nodes can't have values" Perhaps it's relevant of Hebrew strings already included to these metadata... Can you reproduce the problem using exiv2 command line tool ? Gilles Caulier No problem here. This simple command $ exiv2 -v -M'set Xmp.photoshop.Headline On Ubuntu 8.10' img_0395-new_5.jpg works fine on Ubuntu as well as Vista here, Valgrind is happy too. Gilles, if you can reproduce this, can you compile the Exiv2 source file xmp.cpp with DEBUG=1 so that XmpParser::encode will produce debug output and post that? Andreas Andreas, It's difficult to reproduce. 1/ I remove all XMP 2/ I start to add some XMP tag: * Properties/Scene=> ok. * Properties/Type => ok. * Properties/Language => ok. * Content/Headline => doesn't work. 3/ This is the trace of Exiv2 : digikam(18249) Digikam::CollectionManager::locationForPath: Testing location 1 "/mnt/data/photo/test/181853.jpg" "/mnt/data/photo" .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 ......X...X CreatorTool = Kipi-plugins-0.2.0-rc2 .....XX.... language = ......X...X language[1] = he .....XX.... Type = ......X...X Type[1] = Data .....XX.... Scene = ......X...X Scene[1] = 010100 ......X...X Headline = test .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/photoshop/1.0/ ......X...X photoshop:Headline = test .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 ......X...X CreatorTool = Kipi-plugins-0.2.0-rc2 ......X...X Headline = test .....XX.... language = ......X...X language[1] = he .....XX.... Type = ......X...X Type[1] = Data .....XX.... Scene = ......X...X Scene[1] = 010100 .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/photoshop/1.0/ ......X...X photoshop:Headline = test .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 ......X...X CreatorTool = Kipi-plugins-0.2.0-rc2 ......X...X Headline = test .....XX.... language = ......X...X language[1] = he .....XX.... Type = ......X...X Type[1] = Data .....XX.... Scene = ......X...X Scene[1] = 010100 .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/photoshop/1.0/ ......X...X photoshop:Headline = test .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 ......X...X CreatorTool = Kipi-plugins-0.2.0-rc2 ......X...X Headline = test .....XX.... language = ......X...X language[1] = he .....XX.... Type = ......X...X Type[1] = Data .....XX.... Scene = ......X...X Scene[1] = 010100 .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/photoshop/1.0/ ......X...X photoshop:Headline = test .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 ......X...X CreatorTool = Kipi-plugins-0.2.0-rc2 ......X...X Headline = test .....XX.... language = ......X...X language[1] = he .....XX.... Type = ......X...X Type[1] = Data .....XX.... Scene = ......X...X Scene[1] = 010100 .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/photoshop/1.0/ ......X...X photoshop:Headline = test .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 ......X...X CreatorTool = Kipi-plugins-0.2.0-rc2 ......X...X Headline = test .....XX.... language = ......X...X language[1] = he .....XX.... Type = ......X...X Type[1] = Data .....XX.... Scene = ......X...X Scene[1] = 010100 .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/photoshop/1.0/ ......X...X photoshop:Headline = test .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 ......X...X CreatorTool = Kipi-plugins-0.2.0-rc2 ......X...X Headline = test .....XX.... language = ......X...X language[1] = he .....XX.... Type = ......X...X Type[1] = Data .....XX.... Scene = ......X...X Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/photoshop/1.0/ ......X...X photoshop:Headline = test .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 ......X...X CreatorTool = Kipi-plugins-0.2.0-rc2 ......X...X Headline = test .....XX.... language = ......X...X language[1] = he .....XX.... Type = ......X...X Type[1] = Data .....XX.... Scene = ......X...X Scene[1] = 010100 ......X...X language = he XMP Toolkit error 102: Composite nodes can't have values .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 ......X...X Software = Kipi-plugins-0.2.0-rc2 ......X...X CreatorTool = Kipi-plugins-0.2.0-rc2 .....XX.... language = ......X...X language[1] = he .....XX.... Type = ......X...X Type[1] = Data .....XX.... Scene = ......X...X Scene[1] = 010100 .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 digikam(18249) Digikam::isJpegImage: mimetype = "JPEG" .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 digikam(18249) KExiv2Iface::KExiv2::getImageOrientation: Orientation => Exif.Image.Orientation => 1 .X....X...X ns=http://ns.adobe.com/tiff/1.0/ ......X...X tiff:Software = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://ns.adobe.com/xap/1.0/ ......X...X xap:CreatorTool = Kipi-plugins-0.2.0-rc2 .X....X...X ns=http://purl.org/dc/elements/1.1/ .....XX.... dc:language = ......X...X dc:language[1] = he .....XX.... dc:Type = ......X...X dc:Type[1] = Data .X....X...X ns=http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ .....XX.... Iptc4xmpCore:Scene = ......X...X Iptc4xmpCore:Scene[1] = 010100 What's wrong here ? Gilles Created attachment 30704 [details]
Metadata Edit XMP Properties panel
Gilles, Look at the line just before the error message, I suspect that is the problem: ......X...X language = he XMP Toolkit error 102: Composite nodes can't have values All other language properties look like this: .....XX.... language = ......X...X language[1] = he Where does that different language property come from? What is the type of the Value of this strange language property in XmpData? Andreas To confirm that such a language property is actually there, maybe it helps to print all XmpData properties at the beginning of XmpParser::encode in xmp.cpp, something like this: // Output XMP properties for (Exiv2::XmpData::const_iterator md = xmpData.begin(); md != xmpData.end(); ++md) { std::cerr << std::setfill(' ') << std::left << std::setw(44) << md->key() << " " << std::setw(9) << std::setfill(' ') << std::left << md->typeName() << " " << std::dec << std::setw(3) << std::setfill(' ') << std::right << md->count() << " " << std::dec << md->value() << std::endl; } To Andreas, #20 The lines : .....XX.... Scene = ......X...X Scene[1] = 010100 ......X...X language = he XMP Toolkit error 102: Composite nodes can't have values Sound like scene properties is broken by language properties informations. But i don't play with it in my code. Look like it's simple : Language : http://lxr.kde.org/source/extragear/graphics/kipi-plugins/metadataedit/xmpproperties.cpp#416 Scene : http://lxr.kde.org/source/extragear/graphics/kipi-plugins/metadataedit/xmpproperties.cpp#426 Both calls libkexiv2 method : http://lxr.kde.org/source/KDE/kdegraphics/libs/libkexiv2/libkexiv2/kexiv2xmp.cpp#307 And that all... I don't play with Language value to set Scene value. All is deleguate to Exiv2 like you can see... Gilles On line 417 of xmpproperties.cpp, this exiv2Iface.setXmpTagString("Xmp.dc.language", d->languageBtn->current()); creates a Exiv2::xmpText value. But Xmp.dc.language is a composite XmpBag. With the following command, I can now recreate the problem: $ exiv2 -M'add Xmp.dc.language XmpText he' img_0395-new_5.jpg XMP Toolkit error 102: Composite nodes can't have values Error: Failed to encode XMP metadata. Apparently the Adobe XMP toolkit requires the property to be set to the correct type of value (I think it should just follow instructions, but that doesn't matter here). This is correct: $ exiv2 -M'add Xmp.dc.language XmpBag he' img_0395-new_5.jpg and digiKam needs to do something similar. What is still unclear is where the correct language property comes from. Is there another place where the language is set? Andreas SVN commit 918586 by cgilles: kipi-plugins from trunk : XMP editor : use composite XmpBag String container to host/retrieve Language of XMP contents. BUG: 181853 M +2 -4 altlangstringedit.cpp M +2 -2 altlangstringedit.h M +2 -1 commenteditdialog.cpp M +4 -6 commentremovedialog.cpp M +4 -4 commentremovedialog.h M +3 -4 exifadjust.cpp M +5 -5 exifadjust.h M +2 -3 exifeditdialog.cpp M +3 -6 exifeditdialog.h M +2 -3 iptceditdialog.cpp M +2 -5 iptceditdialog.h M +2 -3 xmpeditdialog.cpp M +2 -5 xmpeditdialog.h M +84 -39 xmpproperties.cpp M +3 -3 xmpproperties.h WebSVN link: http://websvn.kde.org/?view=rev&revision=918586 just for reference, i confirm this bug is fixed for svn version 933374 |