Recursively dumping image file data to xmp sidecars

Started by Gary, November 22, 2015, 06:37:38 PM

Previous topic - Next topic

Gary

I'm trying the following batch command on files that contain Artist data in the EXIF.

echo ***INFO*** Generating XMP sidecars image files in %1 and its subdirectories >> "C:\Users\Gary Gauthier\Desktop\ExifTool_Logs\Test001.txt"
exiftool -ext CR2 -ext NEF -ext JPG -ext TIF -tagsfromfile @ "-C:\Users\Gary Gauthier\Desktop\arg_files\exif2xmp.args" %d%f.xmp -r %1 >> "C:\Users\Gary Gauthier\Desktop\ExifTool_Logs\Test001.txt"

This should result in an XMP sidecar, but the message says:

Warning: No writable tags set from C:/Users/Gary Gauthier/Desktop/Raw Images - Copy/Canon EOS 30D/2009-07-18 (Grizzly Day Use Area, Kananaskis Country, AB, CA)/IMG_4572.CR2

It's likely something simple, but I can't see it.

Gary

Got It!!!

The documentation is a wee bit ambiguous when it comes to what happens in when recursive commands are used in a batch file.
To create XMP sidecars from existing RAW files, I needed to do the following:

echo ***INFO*** Generating XMP sidecars image files in %1 and its subdirectories
echo ***INFO*** Generating XMP sidecars image files in %1 and its subdirectories >> "C:\Users\Gary Gauthier\Desktop\ExifTool_Logs\Test001.txt"
exiftool -ext CR2 -ext NEF -ext JPG -ext TIF -tagsfromfile @ "C:\Users\Gary Gauthier\Desktop\arg_files\exif2xmp.args" "C:\Users\Gary Gauthier\Desktop\arg_files\iptc2xmp.args" "C:\Users\Gary Gauthier\Desktop\arg_files\gps2xmp.args" -o %%d%%f.XMP -r %1 >> "C:\Users\Gary Gauthier\Desktop\ExifTool_Logs\Test001.txt"

I believe the documentation says somewhere that the .args files can be relative to the location of the exiftool, so could this could be simplified by putting the .args in the same directory as the exiftool. Shouldn't the reference become something like @ .\exif2xmp.args or even @ exif2xmp.args ?

Phil Harvey

Hi Gary,

Your commands have numerous problems:

Quoteexiftool -ext CR2 -ext NEF -ext JPG -ext TIF -tagsfromfile @ "-C:\Users\Gary Gauthier\Desktop\arg_files\exif2xmp.args" %d%f.xmp -r %1 >> "C:\Users\Gary Gauthier\Desktop\ExifTool_Logs\Test001.txt"

You forgot the -@ option before the argfile, and the argfile has an extra "-" before it that it shouldn't.  Also, you forgot the -o option before -o %d%f.xmp.  And if this is in a Windows .BAT file, you need to double the percents in the ExifTool arguments: %%d%%f.xmp

Quoteexiftool -ext CR2 -ext NEF -ext JPG -ext TIF -tagsfromfile @ "C:\Users\Gary Gauthier\Desktop\arg_files\exif2xmp.args" "C:\Users\Gary Gauthier\Desktop\arg_files\iptc2xmp.args" "C:\Users\Gary Gauthier\Desktop\arg_files\gps2xmp.args" -o %%d%%f.XMP -r %1 >> "C:\Users\Gary Gauthier\Desktop\ExifTool_Logs\Test001.txt"

The -o problems are fixed, but again your .args files are missing -@ options for each.

And yes, you don't need to specify the directory for the .args files if this is the working directory when running the command.

- Phil

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Gary

Phil;

I tried taking the code in which you said everything was fixed, except that I needed the "-@" before each of the .args files. I added the "-@" before each .args file to get the following:

exiftool -ext CR2 -ext NEF -ext JPG -ext TIF -tagsfromfile -@ "C:\Users\Gary Gauthier\Desktop\arg_files\exif2xmp.args" -@ "C:\Users\Gary Gauthier\Desktop\arg_files\iptc2xmp.args" -@ "C:\Users\Gary Gauthier\Desktop\arg_files\gps2xmp.args" -o %%d%%f.XMP -r %1 >> "C:\Users\Gary Gauthier\Desktop\ExifTool_Logs\Test001.txt"


However; it is still giving the following error message:

File '-@' does not exist for -tagsFromFile option

It seems to indicate that it thinks that "-@" is a .args file. Did I miss something in what you said?

Phil Harvey

Now you have forgotten the @ argment for -tagsFromFile.  Try this:

exiftool -ext CR2 -ext NEF -ext JPG -ext TIF -tagsfromfile @ -@ "C:\Users\Gary Gauthier\Desktop\arg_files\exif2xmp.args" -@ "C:\Users\Gary Gauthier\Desktop\arg_files\iptc2xmp.args" -@ "C:\Users\Gary Gauthier\Desktop\arg_files\gps2xmp.args" -o %%d%%f.XMP -r %1 >> "C:\Users\Gary Gauthier\Desktop\ExifTool_Logs\Test001.txt"

The options are:
  • -ext CR2
  • -ext NEF
  • -ext JPG
  • -ext TIF
  • -tagsfromfile @
  • -@ "C:\Users\Gary Gauthier\Desktop\arg_files\exif2xmp.args"
  • -@ "C:\Users\Gary Gauthier\Desktop\arg_files\iptc2xmp.args"
  • -@ "C:\Users\Gary Gauthier\Desktop\arg_files\gps2xmp.args"
  • -o %%d%%f.XMP
  • -r

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Gary

Ok. Now I understand what you meant. I really hadn't expected to be correct about the initial "@" and missing a subsequent "-@".
I'm so sorry to bother you Phil, but this script is a bit more complex than I've tried in past and this syntax issue eluded me.