how to copy embedded xmp tags between tif files?

Started by Sophorus, January 06, 2021, 05:50:28 PM

Previous topic - Next topic

Sophorus

Hello,
Can you help me with the commands for copying xmp metadata from one set of tif files to a modified set of these same files? The files are single band aerial images taken with a multispectral camera.  The modification consisted in adjusting the image brightness to a common median.  Given that the metadata was lost when the modified files were saved to disk, I now need to transfer the original metadata to the modified images. 

This appears to work fine for exif data with the following:   

$ exiftool -tagsfromfile *.tif -exif:all ../dst/*.tif

However the same does not work for the embedded xmp data. When executing

$ exiftool -tagsfromfile *.tif -xmp:all ../dst/*.tif

only one of the 39 embedded xmp tags (TimeStamp) is copied.

If I request a specific tag such as in

$ exiftool -tagsfromfile IMG_0045_3.tif -xmp:BandName ../dst/IMG_0045_3.tif

Then I get the following error:
Warning: Tag 'xmp:bandname' is not defined - IMG_0045_3.tif
Warning: No writable tags set from IMG_0045_3.tif

    0 image files updated
    1 image files unchanged

Any help would be much appreciated.

P.S. I am using exiftool version 11.88 on Ubuntu 20.04

StarGeek

It sounds like exiftool doesn't have definitions for those tags.  Would missing tags be ones covered by the Pix4d.config file?  I mention it because I recognized that BandName was covered by that config file.

If so, then all you need to do is save that config file in the same directory as exiftool and start the command using the -Config option.

If that config file isn't what's needed, you can either attempt to make a config file so exiftool has the appropriate definitions (see the example.config file) or you could copy the XMP as a block with a command like this (see last paragraph of FAQ #9)
exiftool -tagsfromfile IMG_0045_3.tif -xmp ../dst/IMG_0045_3.tif

Quote from: Sophorus on January 06, 2021, 05:50:28 PMP.S. I am using exiftool version 11.88 on Ubuntu 20.04
That version is nearly a year old, so you might see if you can update it.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Sophorus

Thank you StarGeek for your very prompt reply.  I will check if the tags in the Pix4d.config file, which you graciously provided, are a good match with the xmp tags in my images.  I'll try it out tomorrow and let you know if it worked.   :D

Sophorus

With the pix4d.config file in the same directory as my source images, I ran

$ exiftool -Config pix4d.config -tagsfromfile IMG_0045_3.tif -xmp:BandName ../dst/IMG_0045_3.tif

and found it to work just as expected, that is it copied the BandName tag. 
Thanks again for your help and for providing the pix4d.config file.  :)

StarGeek

How about the other tags in the file?  You said that in the first post that only 1 of 39 were copied.  Where the rest copied using the config file?
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Sophorus

My thinking was that I would only copy the tags really needed by pix4d to stitch the mosaic, but then after reading a little more, I thought it would be simpler to copy everything over instead of trying to figure out which of the exif and xmp tags pix4d actually uses in the stitching algorithm.  So I tried the following:

$ exiftool -tagsfromfile src/%f.tif -all:all -xmp -overwrite_original -r dst/*.tif

which so far I have tested on a small set of images, where it is working just fine.



StarGeek

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).