Hello,
I've lost a lot of exif data over the years. To combat this, I wanted to rename a files date by it's modify date ONLY if that date is less than lets say 12 months of the create date.
This would allow me to get a good general idea of the time frame of the photo. Most of my photos go into a folder with a recent date because of missing data. So I end up with 20K photos in 1 Jan 2019 folder.
To be clear I just want to rename the files if the modify date is 12 months or older than the create date. I would get better data this way. Maybe then I can triple stack within bash to get the oldest date IF it's 12 months or older.
Thanks!
Do you mean something like this?:
exiftool -if "$filemodifydate ge ${filecreatedate;ShiftTime($_,'1:0:0 0')}" ...
- Phil
Hey Phil,
Thanks for replying. First I want to say I really really like your software. I've written guides on it over at reddit as well as multiple recommendations.
That aside, I tried your command and received
$modifydate ge ${createdate;ShiftTime($_,'1:0:0 0')}: bad substitution
Any ideas? I am assuming GE stands for greater than or equal to?
Edit, removed the brackets and seems to work. I'll report back!
What OS are you using? You must swap quotes for Mac/Linux. (see my sig)
I see, I am using Linux. I swapped the quote and the code runs.
I cannot get it to meet the condition though. I've tried the following
exiftool -if '$filemodifydate ge $filecreatedate' "file.jpg"
exiftool -if '$filemodifydate le $filecreatedate' "file.jpg"
Is there a list of operators such as GE or LE?
Edit, got it working with exiftool -if '$modifydate lt $createdate' 'test.jpg'
Is there an ELSE operator?
OK. Linux doesn't have a FileCreateDate. I didn't know exactly what tags you wanted to use, so I guessed at the filesystem modification and creation times. You need to swap these for the date/time tags you actually want to check. Use this command to see what is available:
exiftool -time:all -s -G1 FILE
- Phil
Edit: You can google for a list of Perl operators. There is no ExifTool -else option.