1

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?

2

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>

  • 1
    It doesn't seem to work. I tried: exiftool "-CreateDate<Directory 00:00:00" -r ./ and got errors like: Warning: No writable tags set from ./2015/03/03/IMG_3472.JPG Maybe it has to do with the fact that the Directory tag starts with a ./ ? – wilk Aug 7 '15 at 13:04
  • Two things to try, mistakes on my part. If you're running on linux/mac, change the double quotes to single quotes. Also, I forgot to add a dollar sign to the assignment because of mixing tag and text. So try this 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. – StarGeek Aug 7 '15 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.