Edit UserComment with year from CreateDate?

Started by Henrik Jordahn, March 07, 2011, 05:04:26 AM

Previous topic - Next topic

Henrik Jordahn

In trying to organize all my photos, I would also like to modify the UserComment to display the correct year for the copyright.
Some files have the wrong year until some time in January when I usually remember to change the text in the camera.

This command changes the usercomment nicely, but is it possible to extract the year from the file instead of having to run the command on the folder for a given year each time?

exiftool '-usercomment=COPYRIGHT Henrik Jordahn 2009 henrik@jordahn.dk' /media/_SatorSquare/test6/



EDIT:
Yes there is, this seems to work nicely for me:

exiftool '-usercomment<createdate' -d 'COPYRIGHT Henrik Jordahn %Y henrik@jordahn.dk' /media/_SatorSquare/test6/

Phil Harvey

You seem to have found a solution.  You can add the following -if condition to only modify files with the wrong date:

-if '$userComment=~/2010/ and $createdate=~/2011/'

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