globaltimeshift and '-if' expression

Started by comp3v, January 26, 2013, 09:01:20 PM

Previous topic - Next topic

comp3v

I had the task to filter all images before certain date (and, optionally, adjust their time) - and the following command worked just perfectly:
exiftool -createdate+=2 -if "$DateTimeOriginal lt '2011:09:24'" mydir
However, when I tried to use shifted date for renaming (without changing headers), with the following -
exiftool "-filename<datetimeoriginal" -globaltimeshift 2 -d "%d %Hh%M %%f.%%e" -if "$DateTimeOriginal lt '2011:09:24'" mydir
- this worked in a strange way. Instead of renaming of all files where DateTimeOriginal<'2011:09:24', it affected only files with DateTimeOriginal<'2011:09:21'. Moreover, result depended on SHIFT value which I indicated for globaltimeshift (for example, setting -globaltimeshift -72 with -if "$DateTimeOriginal lt '2011:09:24'" selected correctly files with DateTimeOriginal<'2011:09:24' - but obviously I couldn't use it because I need another shift). Is it possible that -globaltimeshift somehow works before evaluating -if expression?
Thanks!

Phil Harvey

Yes, GlobalTimeShift works on the formatted values of all tags, including those in the -if expression.  If you don't want the shifted value, use $DateTimeOriginal# in the -if expression instead.

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

comp3v

ah, now it's clear, thank you very much!