Hi,
I have been using the command:
exiftool "-Subject<RegionPersonDisplayName" -overwrite_original -r .
to make Picasa face tags accessible to Lightroom and it works well apart from the fact the image file is updated even if there is no need to update the file. For example, if I run the command and then immediately run it again, the file's modification date is updated a second time. The main issue I have with this is that I have my photos synced to cloud storage which uses the file's last modified date. If I run the exiftool command on the root folder of my photos, even if only a couple of images have changed tags, all my photos are re-uploaded to the cloud.
Of course I could just remember which photos I have modified and run the exiftool command only on those, but that is stretching my organisational patience.
Is is possible to run the command so that the file's modified date is only changed if the tags actually need to be updated?
Thanks.
You can add a -if statement to process the file only if Subject doesn't already contain the RegionPersonDisplayName:
exiftool -if "not $subject or $subject!~/$regionpersondisplayname/" "-Subject<RegionPersonDisplayName" -overwrite_original -r .
(The above quoting is for Windows. Use single quotes instead on Mac/Linux.)
- Phil
Thanks for the very quick reply and I have a much better understanding of the command line syntax following that example.
It almost works however it misses the case where a name is removed from an image. For example, in Picasa I mark joe, jane and mary, run the exiftool command, then in Picasa I delete mary or all the names. Using your command line, the subject tag won't get updated. (Subject isn't empty and there isn't a new name on the list.) This is probably a rare case but it would be good to address it if possible.
I'm not exactly sure what your requirements are. If you just want to update Subject if it is different, you could do this:
exiftool -if "not $subject or $subject ne $regionpersondisplayname" "-Subject<RegionPersonDisplayName" -overwrite_original -r .
However, this will delete other Subject tags if you added any.
- Phil
You're right, what I was thinking of (e.g. deleting Mary) won't work because it won't be possible to distinguish whether Mary was added to regionpersondisplayname by a previous instance of Exiftool copying a value from Picasa (in which case it should be deleted) or whether Mary was written from within Lightroom (in which case it should be kept). I think your original suggestion is the best.
Thanks.