Free tool to batch-set photo file dates from EXIF metadata
Asked 9/14/2012
5 views
2 answers
0
I need a free program that can scan a folder and its subfolders, find image files with EXIF date/time data, and set each file’s filesystem timestamp to match the EXIF capture date. Ideally it should support batch processing, and command-line or GUI options are both fine.
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
13y ago
2 Answers
75
This is the inverse of Is there any software which will set the EXIF Dates based on the file's modification date?, and I'm sure all of the programs listed there will apply.
jheadOf these, for this very simple task, jhead is my suggestion. For example, the command
jhead -ft *.jpg
sets a bunch of files so that the file timestamp matches EXIF.
jhead with find, for going through subdirectories
In order to perform recursion into subdirectories, you could to combine it with the find command available on Linux/Unix/Mac (or Cygwin for Windows):
find . -name '*.jpg' -exec jhead -ft {} +
Or to find any of *.JPG *.JPEG *.jpg *.jpeg ... you can also try
find . -iname '*.jp*g' -exec jhead -ft {} +
You can also use find to just show all the files that would be... found, without executing any other command (like jhead):
find . -iname '*.jp*g'
Other Tools
Other utilities like ExifTool or Exiv2 are much more capable, but at the price of complexity. I can never remember offhand the right options to do anything with those and have to look at the documentation every time, but jhead -ft is easy to remember with the mnemonic "fix time".
ExifTool
Just for completeness, though, I did look at the documentation, and with ExifTool, do this:
exiftool -r '-DateTimeOriginal>FileModifyDate' directoryname
(Remove the -r if you don't want recursion, and if you do that, you can also give a list of files or a wildcard instead of directoryname.) And be careful with those quotes — if you're running this on Windows, you want " instead of '.
Exiv2
With Exiv2:
exiv2 -T rename *.jpg
Beware that with lowercase -t (or without any -T) Exiv2 will also rename the file to a new name based on the timestamp, which may be very confusing. Exiv2 also does not do recursion.
Originally by user1943. Source · Licensed CC BY-SA 4.0
user1943
13y ago
0
Generated from our catalog & community — verify before relying on it.
Yes. Free tools mentioned by the community that can do this include jhead, IrfanView, and exiv2.
For a simple batch workflow, jhead is a common choice:
- Single folder:
jhead -ft *.jpg - Recursive on Linux/macOS/Unix:
find . -iname '*.jp*g' -exec jhead -ft {} +
That sets the file timestamp to match the EXIF date/time in JPEGs.
If you prefer a GUI, IrfanView can also copy date/time between EXIF and the file timestamp, either one file at a time or in batch mode. It can also be run from the command line.
Another command-line option is exiv2, which can update the modified date as a side effect of its rename operation.
A few notes:
- These tools rely on the image having valid EXIF date/time metadata.
- The examples given are specifically for JPEG files.
- Recursive processing with
findis especially useful if your photos are spread across many subfolders.
Recommended products
UniqueBot
AI13y ago
Your Answer
Related Questions
How can I batch-edit photo metadata, especially missing capture dates, on Linux or Windows?
How can I set a file’s modified date to the photo’s original capture date with ExifTool?
Free Windows software to export image metadata from folders and subfolders to a single CSV
How can I set photo capture dates from filenames before uploading to Google Photos?
How can I batch-convert RAW files to TIFF on macOS using Apple’s processing engine?