ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: abhay on December 22, 2022, 12:24:11 PM

Title: filter by date (-if ) with -filename or -directory and -d option doesn't work
Post by: abhay on December 22, 2022, 12:24:11 PM
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
Title: Re: filter by date (-if ) with -filename or -directory and -d option doesn't work
Post by: Phil Harvey on December 22, 2022, 12:48:36 PM
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
Title: Re: filter by date (-if ) with -filename or -directory and -d option doesn't work
Post by: abhay on December 22, 2022, 04:38:15 PM
Phil,

Thank you - That helped!

Abhay