ExifTool Forum

ExifTool => Newbies => Topic started by: JobWellDone on May 10, 2023, 07:56:10 AM

Title: Apply default.xmp to all RAW images in the folder.
Post by: JobWellDone on May 10, 2023, 07:56:10 AM
I have folder with files

default.xmp
_DSC0001.ARW
_DSC0002.ARW
_DSC0003.ARW


What i want to get is three new XMP files that have with same contents as default.xmp with name of each image in the folder.

default.xmp
_DSC0001.ARW
_DSC0001.xmp
_DSC0002.ARW
_DSC0002.xmp
_DSC0003.ARW
_DSC0003.xmp

Title: Re: Apply default.xmp to all RAW images in the folder.
Post by: StarGeek on May 10, 2023, 11:20:49 AM
This would be Example #13 (https://exiftool.org/metafiles.html#EX13) on the Metadata Sidecar Files page except instead of using -TagsFromFile @ you would hardcode it to your default file, -TagsFromFile /path/to/default.xmp.

You would set the -ext (-extension) option (https://exiftool.org/exiftool_pod.html#ext-EXT---ext-EXT--extension) to the type of file you want to process, e.g. -ext ARW, or if you want to included all files, you would use --ext xmp to avoid processing any existing xmp files.

exiftool -ext ARW -TagsFromFile /path/to/default.xmp -srcfile %d%f.xmp -r DIR
Title: Re: Apply default.xmp to all RAW images in the folder.
Post by: JobWellDone on May 10, 2023, 11:44:10 PM
Thanks a lot for this response, works great.

Quote from: StarGeek on May 10, 2023, 11:20:49 AMyou would use --ext xmp to avoid processing any existing xmp files.
However using --ext xmp, ExifTool still updates existing .xmp files.
Title: Re: Apply default.xmp to all RAW images in the folder.
Post by: StarGeek on May 11, 2023, 12:07:33 AM
Yes, because you are explicitly writing to the XMP sidecar files.  It will avoid copying the XMP files back onto themselves.  For example, when it reads _DSC0001.ARW, it will copy from the default into _DSC0001.xmp.  Without --ext xmp, it will then read _DSC0001.xmp and copy the data directly back into _DSC0001.xmp.

If you only want to create new XMP sidecar files, look at example #11.