filter by date (-if ) with -filename or -directory and -d option doesn't work

Started by abhay, December 22, 2022, 12:24:11 PM

Previous topic - Next topic

abhay

Hello,

Following seems to be broken.

exiftool -o . -if "$datetimeoriginal gt '2022:12:01'" "-directory<datetimeoriginal" -d "%Y/%m/" -ext jpg SRCDIR

exiftool -if "$datetimeoriginal gt '2022:12:01'" "-testname<datetimeoriginal" -d "%Y/%m/%%f.%%e" -ext jpg SRCDIR

However, if -d doesn't contain %Y %m or other substitution patterns, then -if filter works fine!

Doesn't Work => reports "files failed condition"

I tried in both windows and ubuntu 22.04
exiftool is latest version 12.52

Phil Harvey

The -d option affects all date/time values, even those in your -if expression.  Use $datetimeoriginal# instead of $datetimeoriginal in your -if expression to disable the date/time formatting.

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