ExifTool Forum

ExifTool => Newbies => Topic started by: qwerty15 on June 10, 2018, 03:49:18 PM

Title: Writing -DateTimeOriginal with directory
Post by: qwerty15 on June 10, 2018, 03:49:18 PM
Hi all!
I am just getting started with ExifTool to manage old family photos I am digitizing. I would like them to have accurate date exif data. They are already ordered chronologically, so they are in computer folders by year, ie each photo from 1950 is in a folder named "1950". I can now change the date Exif data for all photos in an individual folder, but this could be made miraculously fast if I could instead change the date using a generalized command with the year replaced by something like -Directory. However I'm on macOS and the actual directory is the entire file path, /User/[user]/desktop/FamilyPhotos/1950 . Anyone know how I could utilize these handy folder names in writing the exif date?
Thanks so much!!!!
Title: Re: Writing -DateTimeOriginal with directory
Post by: StarGeek on June 10, 2018, 04:52:05 PM
See FAQ #5 (https://exiftool.org/faq.html#Q5) paragraph 3.

So yes, you can use Directory as long as the only numbers are the ones you want to use and you fill out the rest of the numbers (month, date, hour, etc).  With your example of "/User/[user]/desktop/FamilyPhotos/1950", you could use "-alldates<$directory 0101 000000" which would set all the EXIF date tags to "1950:01:01 00:00:00".

If your directory had extra numbers, for example something like "/User/[user]/desktop/FamilyPhotos/Batch 001/1950", then something else would have to be done, as the 001 would throw things off.

Bonus answer, because it's usually a follow up to questions like this, to increment seconds so as to keep the images in a certain order, see this post (https://exiftool.org/forum/index.php/topic,5621.msg27394.html#msg27394).
Title: Re: Writing -DateTimeOriginal with directory
Post by: qwerty15 on June 10, 2018, 07:22:19 PM
Thanks so much! very helpful!