ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: garlin on September 24, 2018, 08:24:00 PM

Title: Print filename while using -if conditional
Post by: garlin on September 24, 2018, 08:24:00 PM
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?
Title: Re: Print filename while using -if conditional
Post by: Phil Harvey on September 24, 2018, 09:41:20 PM
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
Title: Re: Print filename while using -if conditional
Post by: StarGeek on September 24, 2018, 09:58:56 PM
Maybe also try the -progress option (https://exiftool.org/exiftool_pod.html#progress-:-TITLE)?
Title: Re: Print filename while using -if conditional
Post by: garlin on September 24, 2018, 10:20:48 PM
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!