ExifTool Forum

ExifTool => Newbies => Topic started by: mesqueeb on September 03, 2018, 02:28:39 AM

Title: How to shift time based on the previous/next folder going though several folders
Post by: mesqueeb on September 03, 2018, 02:28:39 AM
So I have about 10,000 photos divided in a lot of folders.

Each folder has only photos of no more than 1 day, however, several folders can have pictures of the same day.

Each folder has the photos in order based on the time starting at 18:00 ending at 20:00 or so.

In the case folder [A] has photos of the same day as folder , both of the folders photos are ordered with the time stamp starting at 18:00, incrementing a few min/sec until around 20:00 or so.

I want to:


→ all above mentions of "date" and "time" refer to `MDItemFSCreationDate` and `AllDates` which are synced for all of these 4 tags.

Now I'm used to doing small stuff with exiftool, but not something like this, so I'd love some advice!

I know you can change just the part of the photo's timestamp or just the part of the date with perl regular expressions like so:

exiftool /Users/test/photos '-MDItemFSCreationDate<${MDItemFSCreationDate;s/ .*//} ${MDItemFSContentChangeDate;s/.* //}' '-AllDates<${MDItemFSCreationDate;s/ .*//} ${MDItemFSContentChangeDate;s/.* //}' -r


But I'm not sure how to retrieve values of photos in previous folders etc.

I'm a JavaScript developer, so go easy on me : )
Title: Re: How to shift time based on the previous/next folder going though several folders
Post by: Phil Harvey on September 04, 2018, 04:04:35 PM
Unfortunately, ExifTool is file based, not folder based.  So you can't evaluate a condition based on the first photo in a folder.  You would need to do this with some other type of script (batch file, shell script, php, perl, python, etc).

- Phil