ExifTool Forum

General => Metadata => Topic started by: Martla on May 12, 2020, 05:35:14 AM

Title: Write specific XMP tags to images
Post by: Martla on May 12, 2020, 05:35:14 AM
Hi,

I am trying to copy some XMP tags from Camera family (e.g CentralWavelength and BandName) of my image to another image.

I am using the following command: exiftool -tagsfromFile originalimage.tif -xmp-Camera:BandName writeimage.tif but it fails to execute.
Probably it has a very simple solution, but i am not able to find it.
What am i missing?

<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about="Pix4D Camera Information"
            xmlns:Camera="http://pix4d.com/camera/1.0">
         <Camera:RigName>RedEdge</Camera:RigName>
         <Camera:BandName>Blue</Camera:BandName>
         <Camera:CentralWavelength>475</Camera:CentralWavelength>


Thanks in advance!
Title: Re: Write specific XMP tags to images
Post by: Phil Harvey on May 12, 2020, 07:34:41 AM
There is a pix4d.config (https://raw.githubusercontent.com/exiftool/exiftool/master/config_files/pix4d.config) file included in the full distribution that you can use to write these tags with this command:

exiftool -config pix4d.config -tagsfromFile originalimage.tif -xmp-Camera:BandName FILE

- Phil
Title: Re: Write specific XMP tags to images
Post by: Martla on May 12, 2020, 08:03:32 AM
Thanks for the prompt response, Phil!

Would it also be possible to copy more than one tag in one go? Something like:

exiftool -config pix4d.config -tagsfromFile originalimage.tif -xmp-Camera:BandName, CentralWavelength.... FILE

Or for each tag one needs to run separate commands?
Title: Re: Write specific XMP tags to images
Post by: StarGeek on May 12, 2020, 12:29:59 PM
exiftool -config pix4d.config -tagsfromFile originalimage.tif -xmp-Camera:BandName -xmp-CameraCentralWavelength -TAG3 -TAG4 -TAG5 -ETC FILE

See the -TagsFromFile option (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT) docs and Copying Examples (https://exiftool.org/exiftool_pod.html#COPYING-EXAMPLES).
Title: Re: Write specific XMP tags to images
Post by: Martla on May 18, 2020, 03:47:38 AM
Thanks a lot!