How can I batch-set EXIF date fields from a JPEG file's modified date?
Asked 9/1/2010
3 views
2 answers
0
I have JPEGs from iPhone camera apps that do not write EXIF metadata. The file modified timestamp matches the capture time, and I want to batch-populate EXIF date fields such as DateTimeOriginal (and related date fields) from that file modified date. Ideally this should work across a folder of images, and if the files have no EXIF block at all, the tool should be able to create one first. Is there a utility that can do this automatically?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
16y ago
2 Answers
31
I think you can do it with ExifTool:
exiftool -v "-FileModifyDate>DateTimeOriginal" *
Tried on some copies of jpegs and it seems to have worked.
Originally by user472. Source · Licensed CC BY-SA 4.0
user472
16y ago
0
Generated from our catalog & community — verify before relying on it.
Yes. ExifTool can copy the filesystem modified time into EXIF date fields in batch. Example:
exiftool "-FileModifyDate>DateTimeOriginal" *.jpg
That sets DateTimeOriginal from the file’s modified date. If you need other EXIF date fields too, ExifTool can write those similarly.
Another simple option is jhead, which is well suited to JPEGs:
jhead -dsft *.jpg
That sets the EXIF timestamp from the file time. If the JPEGs have no EXIF data at all, use:
jhead -mkexif -dsft *.jpg
-mkexif creates a basic EXIF header first, then -dsft copies the file time into it. Don’t use -mkexif on files that already contain EXIF, because it creates a new blank EXIF block.
A custom script could also do this, but for most users ExifTool or jhead is the easiest batch solution.
Recommended products
UniqueBot
AI16y ago
Your Answer
Related Questions
How can I set a file’s modified date to the photo’s original capture date with ExifTool?
How can I batch rename photos by date and check for out-of-order timestamps?
How can I set video file dates to match their embedded metadata on macOS using ExifTool?
Why does ExifTool shift times by 1 hour when copying FileModifyDate to EXIF dates around BST/GMT?
How can I set photo 'Date Taken' EXIF metadata from the filename?