I have a quick question: Is it possible to get a tag via -tagsFromFile only if that tag is not already set? I'd like to do that in a single command line that does other things as well. If I read it right the -if flag would cancel the whole command's execution if false. What I rather seek is preventing to overwrite a specific tag in case of it being already populated.
You want to conditionally replace an individual tag if it doesn't exist. This is done like this:
exiftool -TAG-= -TAG=NEWVAL ...
You may use -TAG-=OLDVAL to replace the tag if it had value OLDVAL, but if OLDVAL is omitted then the tag is written only if it didn't exist before.
- Phil
Edit: Sorry, I neglected to put this in the context of -tagsfromfile. This is the command to do that:
exiftool -TAG-= -addtagsfromfile @ "-TAG<SOMEOTHERTAG" ...
Note that you must use -addTagsFromFile instead of -tagsFromFile, otherwise the original assignment is superceded.
Thank you very much. That is exactly what I need. Also thanks for pointing out -addTagsFromFile.