Edit a specific XMP tag

Started by popysingh, September 23, 2020, 07:14:47 AM

Previous topic - Next topic

popysingh

I have to change one specific tag for my image. I have tried to define my own custom tag in the config file however output from the exiftool doesn't match the original tags in terms of fonts or formatting or even some specifics words.

Tags are in XMP format. These are the original tags

<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xpacket begin="?" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="Tiff Tag Manager SEMVision">
<xmp:Thumbnails>
<rdf:Alt>
<rdf:li xml:lang="x-default">
<xapGImg:tag1>tag1</xapGImg:tag1>
<xapGImg:tag2>tag2</xapGImg:tag2>
<xapGImg:tag3>tag3</xapGImg:tag3>
</rdf:li>
</rdf:Alt>
</xmp:Thumbnails>
<Date>2020-09-08T15:56:40+03:00</Date>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta><?xpacket end="w"?>

I would to change the tag1 to tag1_changed and everything should stay exactly same like original tags. This is what I would like to see:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xpacket begin="?" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="Tiff Tag Manager SEMVision">
<xmp:Thumbnails>
<rdf:Alt>
<rdf:li xml:lang="x-default">
<xapGImg:tag1>tag1_changed</xapGImg:tag1>
<xapGImg:tag2>tag2</xapGImg:tag2>
<xapGImg:tag3>tag3</xapGImg:tag3>
</rdf:li>
</rdf:Alt>
</xmp:Thumbnails>
<Date>2020-09-08T15:56:40+03:00</Date>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta><?xpacket end="w"?>


I modified the config file. Now exiftool is writing the meta data from a user defined tag. However, output from Exiftool does not have the same formatting and details like original tags. THis is the output I got from the Exiftool -


<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 11.94'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about=''
  xmlns:xapGImg='http://ns.adobe.com/xap/1.0/g/img'>
  <xapGImg:rev>
   <rdf:Alt>
    <rdf:li xml:lang='x-default'>test</rdf:li>
   </rdf:Alt>
  </xapGImg:rev>
  <xapGImg:tag1>tag1_changed</xapGImg:tag1>
  <xapGImg:tag2>tag2</xapGImg:tag2>
  <xapGImg:tag3>tag3</xapGImg:tag3>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>


I would like to remove all the empty space. Align everything to the right. and change the text of information in the start to be exactly like the original tag.
Only change should be the tag1

I have spent so much time fideling with the config file. Any help will be appreciated.

thanks

Phil Harvey

ExifTool gives you some options to control the format of serialized XMP.  With -api compact=nopadding you can remove the extra padding.  See the API Compact option documentation for details.

But your original XMP is improperly formatted.  ExifTool won't write invalid XMP like this.  The xmp:Thumbnails items are structures, so they must either be contained within another rdf:Description, or have parseType="resource".  Also, the "<?xml" header is not part of the XMP specification.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).