News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Print filename while using -if conditional

Started by garlin, September 24, 2018, 08:24:00 PM

Previous topic - Next topic

garlin

I'm trying to reset filesystem times on a batch of photos, using tag -DateTimeOriginal.  Which is straightforward; but I want to see only which files got updated and not warnings about skipped files.  This example updates my timestamps, but fails to print anything except for the final summary.

exiftool -p '$filename' '-FileCreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal' -if '$DateTimeOriginal' 2011DinnerPic.jpg
    1 image files updated

If I don't require any file updates, the command works as expected.

exiftool -p '$filename' -if '$DateTimeOriginal' 2011DinnerPic.jpg
2011DinnerPic.jpg

What am I missing?

Phil Harvey

Your first command is writing metadata so the -p option is ignored.  -p is for formatting the output when reading.

You could get the name of all processed files by adding the -v0 option:

exiftool -v0 '-FileCreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal' -if '$DateTimeOriginal' 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 ($).

StarGeek

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

garlin

Before your reply, I did suspect it wasn't allowed.  But nothing found on the web would confirm it was by design.  Thanks for your tips!