After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782208 - Unable to register 'Iptc4xmpExt' XMP namespace
Unable to register 'Iptc4xmpExt' XMP namespace
Status: RESOLVED OBSOLETE
Product: gexiv2
Classification: Other
Component: implementation
0.10.x
Other Linux
: Normal normal
: ---
Assigned To: Gexiv2 Maintainers
Gexiv2 Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-05-05 09:07 UTC by Jim Easterbrook
Modified: 2018-05-22 12:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jim Easterbrook 2017-05-05 09:07:15 UTC
I think my problem is caused by Exiv2 abbreviating Iptc4xmpExt to iptcExt.

I'm trying to add location metadata such as Xmp.iptcExt.LocationShown[1]/Iptc4xmpExt:City. I get "Unknown namespace prefix for qualified name" errors unless the XMP file already has the Iptc4xmpExt namespace registered. If I try to register it with register_xmp_namespace('http://iptc.org/std/Iptc4xmpExt/2008-02-29/', 'Iptc4xmpExt') the call return false. I assume this is because Exiv2 already has the iptcExt namespace predefined and thinks they're equivalent.
Comment 1 Jens Georg 2017-05-05 10:22:00 UTC
As far as I understood you can just use iptcExt in you code, the image will be written correctly nevertheless.
Comment 2 Jim Easterbrook 2017-05-05 10:29:12 UTC
The problem is with the second part of the tag name. Using Xmp.iptcExt.LocationShown[1]/iptcExt:City allows me to save data without registering the 'Iptc4xmpExt' namespace, but the file can't then be modified by other tools.

As far as I can tell the second part (Iptc4xmpExt:City) has to use the Iptc4xmpExt namespace and that namespace has to be registered.
Comment 3 Jim Easterbrook 2017-05-12 07:21:31 UTC
I've found a workaround now:
1/ set the 'bag' tag Xmp.iptcExt.LocationShown
2/ use generate_xmp_packet to get a string of XMP data
3/ change every occurrence of 'iptcExt' in the string to 'Iptc4xmpExt'
4/ create a new GExiv2.Metadata object and use open_buf to read the modified string
This gets the 'Iptc4xmpExt' namespace registered by the back door and allows the Xmp.iptcExt.LocationShown[1]/Iptc4xmpExt:City tag to be used without errors.
Comment 4 Jens Georg 2017-05-12 08:07:28 UTC
ew, that sounds ugly. Reopen, that needs something more user-friendly.
Comment 5 Jim Easterbrook 2017-05-13 08:48:12 UTC
There is an inconsistency in how Exiv2 writes XMP data.
1/ Create an empty XMP file:
echo "<x:xmpmeta x:xmptk='XMP Core 4.4.0-Exiv2' xmlns:x='adobe:ns:meta/'></x:xmpmeta>" >test.xmp
2/ Write some tags:
exiv2 -M"set Xmp.iptc.Location  XmpText  West Wallaby St" test.xmp
exiv2 -M"set Xmp.iptcExt.DigitalSourcefileType  XmpText  camerajpeg" test.xmp
3/ Look at the file:
more test.xmp
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:iptcExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/"
    xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
   iptcExt:DigitalSourcefileType="camerajpeg"
   Iptc4xmpCore:Location="West Wallaby St"/>
 </rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>

Note that the Xmp.iptc tag uses the proper Iptc4xmpCore namespace but the Xmp.iptcExt tag does not use the proper Iptc4xmpExt namespace. I'm not enough of an XMP expert to say if this is a bug or not.
Comment 6 Jens Georg 2017-05-13 09:06:59 UTC
I will take that to the exiv2 project. It really looks odd.
Comment 7 GNOME Infrastructure Team 2018-05-22 12:36:03 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gexiv2/issues/24.