Restore Photographs Created and Modified dates

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I have a number of photographs that have lost their orginal created and modified dates...

is there a way to restore photographs that have lost thier created and modified dates?

Paul
Paul1762
 
Posts: 49
Joined: Sat Nov 08, 2014 5:32 pm

Unless they are recorded elsewhere, not sure if that is possible.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

potentially yes using EXIFTOOL. The system create and modify dates may be distinct from other image file properties that have been retained because they are not modified normally by the OS. It depends on the devices that were used to take the pictures and what is stored. Download and install this tool: http://www.sno.phy.queensu.ca/~phil/exiftool/

Once installed, run the following in terminal:
Code: Select all
exiftool [path to image file]
in terminal. You will see the EXIF data and various date properties. Perhaps something like Create Date (different from file creation date) or Date/Time Original will have the retained image property values. If so, I have written a series of scripts that I use with hazel to modify the file create and modify dates to match these properties so as to retain the original values. Let me know and I can send them to you.
dhy8386
 
Posts: 96
Joined: Tue Nov 09, 2010 12:19 pm

You might be able to and there are two ways this could be possible.
Use A Better Finder Attributes which can set the date created / modified based on the EXIF date.
If no EXIF date exists but your files are named in a specific format i.e. 2014-12-24 13:23:43.jpg you can use this script in the terminal to set the date created / modified. You will need the Xcode Terminal Commands installed - your Mac should prompt you if you want to install them if you're running the command for the first time.
Code: Select all
for f in *.jpg;
do date=$(printf %s "$f" | sed -E 's|^(....)-(..)-(..) (..)\.(..)\.(..).*|\2/\3/\1/ \4:\5:\6|'); SetFile -m "$date" -d "$date" "$f";
done

Change this section to suit your naming convention:
Code: Select all
sed -E 's|^(....)-(..)-(..) (..)\.(..)\.(..).*|\2/\3/\1/ \4:\5:\6|'

2014-12-24 13.23.43.jpg
(....)-(..)-(..) (..)\.(..)\.(..).*|\2/\3/\1/ \4:\5:\6


Hope that helps.
andy_vdg
 
Posts: 5
Joined: Sat Dec 27, 2014 6:45 pm


Return to Support