ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: med on January 25, 2024, 07:24:28 AM

Title: Extract XMP tags and inject them
Post by: med on January 25, 2024, 07:24:28 AM
hello,

thank you all for your contributions !

I want to add 2 XMP tags to a photo which don't have any.



XMP tags values

Adobe XMP Core 5.1.0-jc003
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><subimage offset="12669" length="12669" paddingx="76" paddingy="56" width="428" height="56" rotation="180" /><timewatermark offset="22533" length="9864" width="426" height="53" paddingx="78" paddingy="58" isLTR="true" />

I try to follow this topic: Extract all xmp binary data if the data is spread over multiple sections (https://exiftool.org/forum/index.php?topic=15561.0) by doing this



XMP output

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.0-jc003">
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <rdf:Description rdf:about=""
        xmlns:MiCamera="http://ns.xiaomi.com/photos/1.0/camera/"
      MiCamera:XMPMeta="&lt;?xml version='1.0' encoding='UTF-8' standalone='yes' ?&gt;&lt;subimage offset=&quot;12669&quot; length=&quot;12669&quot; paddingx=&quot;76&quot; paddingy=&quot;56&quot; width=&quot;428&quot; height=&quot;56&quot; rotation=&quot;180&quot; /&gt;&lt;timewatermark offset=&quot;22533&quot; length=&quot;9864&quot; width=&quot;426&quot; height=&quot;53&quot; paddingx=&quot;78&quot; paddingy=&quot;58&quot; isLTR=&quot;true&quot; /&gt;"/>
  </rdf:RDF>
</x:xmpmeta>

I have the following message
Warning: No writable tags set photo1.xmp
    0 image files updated
    1 image files unchanged


What am I doing wrong?
Thanks for your help
Title: Re: Extract XMP tags and inject them
Post by: Phil Harvey on January 25, 2024, 08:09:43 AM
ExifTool must have definitions for tags to be able to write them individually, but the MiCamera namespace is currently not defined (see here (https://exiftool.org/TagNames/XMP.html) for a list of pre-defined XMP tags).

But you can write the XMP as a block.  This will write the unknown tags, but the only difference here is that existing XMP in the target file will be overwritten:

exiftool "-xmp<=photo1.xmp" photo2.jpg

The alternative is to create user-defined tags to allow these tags to be written individually.  See the sample config file (https://www.exiftool.org/config.html) for instructions/examples on how to do this.

- Phil
Title: Re: Extract XMP tags and inject them
Post by: med on January 25, 2024, 11:13:55 AM
it's work fine

thank you so much !!