Dear community,
I have numerous photos from Fuji X cameras. Those cameras put specific values to Exif to indicate low-quality shots - Blur Warning, Focus Warning and Exposure Warning. One photo can contain one, two to three warnings (or none).
I'm trying to create XMP sidecars with keywords based on these values. However, XMP creation is trigged with first match and never updates with next if's.
My command is (I'm Mac user):
exiftool \
-if '$FujiFilm:BlurWarning eq "Blur Warning"' -XMP-dc:Subject+=Blur -XMP-lr:HierarchicalSubject+=Blur -execute \
-if '$FujiFilm:ExposureWarning eq "Bad exposure"' -XMP-dc:Subject+=ExposureWarning -XMP-lr:HierarchicalSubject+=ExposureWarning -execute \
-if '$FujiFilm:FocusWarning eq "Out of focus"' -XMP-dc:Subject+=FocusWarning -XMP-lr:HierarchicalSubject+=FocusWarning \
-common_args -o %d%f.xmp "/Users/paul/Desktop/DSCF2579.RAF"
The problem lies with how the -o (outfile) option (https://exiftool.org/exiftool_pod.html#o-OUTFILE-or-FMT--out) works. The important part of the docs is:
Existing files will not be overwritten.
The -o option attempts to create a new file. After the first -if is matched, a new file is created. Subsequent matches cannot create a new file, so that addition is skipped.
I think what you want to use is Sidecar example #13 (https://exiftool.org/metafiles.html#EX13%5B/tt). So instead of
-common_args -o %d%f.xmp "/Users/paul/Desktop/DSCF2579.RAF"
try
-common_args -ext RAF -tagsfromfile @ -srcfile %d%f.xmp "/Users/paul/Desktop/DSCF2579.RAF"
I haven't tested this, so make sure you try it out to see if it works.
Thank you, StarGeek
Unfortunately it doesn't work.
All I get is, since .xmp is never created:
Error: File not found - /Users/paul/Desktop/DSCF2579.xmp
Error: File not found - /Users/paul/Desktop/DSCF2579.xmp
Error: File not found - /Users/paul/Desktop/DSCF2579.xmp
This is tricky because you want to test tags in the RAF but edit the XMP files. Something like this should work (and all in one command):
exiftool -tagsfromfile @ \
'-XMP-dc:Subject+<${FujiFilm:BlurWarning;$_ = $_ eq "Blur Warning" ? "Blur" : undef}' \
'-XMP-lr:HierarchicalSubject+<${FujiFilm:BlurWarning;$_ = $_ eq "Blur Warning" ? "Blur" : undef}' \
'-XMP-dc:Subject+<${FujiFilm:ExposureWarning;$_ = $_ eq "Bad exposure" ? "ExposureWarning" : undef}' \
'-XMP-lr:HierarchicalSubject+<${FujiFilm:ExposureWarning;$_ = $_ eq "Bad exposure" ? "ExposureWarning" : undef}' \
'-XMP-dc:Subject+<${FujiFilm:FocusWarning;$_ = $_ eq "Out of focus" ? "FocusWarning" : undef}' \
'-XMP-lr:HierarchicalSubject+<${FujiFilm:FocusWarning;$_ = $_ eq "Out of focus" ? "FocusWarning" : undef}' \
-common_args -srcfile %d%f.xmp -ext raf -r DIR
- Phil