Putting numerous keywords to XMP sidecar

Started by ppoloskov, January 24, 2020, 03:55:36 AM

Previous topic - Next topic

ppoloskov

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"

StarGeek

The problem lies with how the -o (outfile) option 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.  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.


"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

ppoloskov

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

Phil Harvey

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
...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 ($).