I need to set the exif date tag of a bunch of photos stored with the following hierarchy: YEAR/MONTH/DAY/IMG_something.JPG
How could I do it easily with exiftool?
Basically, the command would be something like this
ExifTool "-TAG<Directory" <DIR or FILE>
assuming that the directory structure is numeric e.g. 2015/07/04
But there may be problems depending upon the exact tag you want to use. Many date/time tags require a time as well as a date and I believe all the EXIF date/time tags fall into this category. If you don't care about the actual time, you could -TAG<$Directory 00:00:00
. Or if you want to increment the time, you can see this previous post for some help.
XMP tags are usually more flexible and can be used without a time.
If there is already a current time in the tag and you just want to change the date, you can use something like this
ExifTool "-DateTimeOriginal<$Directory ${DateTimeOriginal;s/.* //" <DIR or FILE>
exiftool '-CreateDate<$Directory 00:00:00' -r ./
The ./
should not be a problem at all. The program's author uses similar examples all the time and I just tested it on my Windows computer and it worked fine.
\$\endgroup\$