How to leverage exiftool to write metadata in a .xmp back into .jpg file?

1

Given a .xmp file as the below, how to leverage exiftool to write the edited metadata in the .xmp back into the associated .jpg file?

 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:MY="http://ns.mylollc.com/MyloEdit/"
    xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
    xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
   exif:DateTimeOriginal="2005-10-17T13:32:55.000Z"
   exif:ModifyDate="2005-10-17T13:32:55.000Z"
   xmp:CreateDate="2005-10-17T13:32:55.000Z"
   xmp:MetadataDate="2019-03-16T04:22:26.827Z"
   MY:DateConfidence="Full"
   MY:flag="false"
   MY:processVersion="1"
   MY:MetadataDate="2019-03-16T04:22:26.827Z"
   tiff:Orientation="1"
   xmpMM:DocumentID="5876F9B0-5C6C-4121-87C3-2708E32B6050"
   xmpMM:OriginalDocumentID="5876F9B0-5C6C-4121-87C3-2708E32B6050"
   xmpMM:InstanceID="xmp.iid:7EDC21BF-371B-4189-90AF-C83A54A6A190"/>
 </rdf:RDF>
</x:xmpmeta>```

Drake Guan

Posted 2019-03-16T05:13:43.290

Reputation: 225

Answers

1

According to https://sno.phy.queensu.ca/~phil/exiftool/metafiles.html, I found out the answer:

  1. Restore all XMP tags from an XMP sidecar file to XMP in a JPG image:

    exiftool -tagsfromfile SRC.xmp -all:all DST.jpg

  2. Restore XMP as a block from an XMP sidecar file to a JPG image: (same effect as above except that any non-writable XMP tags would be copied by this command, and the 2 kB of padding recommended by the XMP specification is not added when copying as a block)

    exiftool -tagsfromfile SRC.xmp -xmp DST.jpg

Drake Guan

Posted 2019-03-16T05:13:43.290

Reputation: 225

1You can also write it as a block like this: exiftool "-xmp<=SRC.xmp" DST.jpg – PhilHarvey – 2019-07-30T15:07:30.520