Restore basic date information

Started by diffusefield, November 12, 2024, 06:05:37 PM

Previous topic - Next topic

diffusefield

Hello,

Several years ago, I made a grave mistake which I have always regretted. I removed all metadata from a number of family photos. Some taken with various iPhone's and a DSLR.

Is there a simple exiftool command that would allow me to restore YYYY-MM-DD so that a program like Apple Photos could recognize them?

Thanks,
Jason

Phil Harvey

Hi Jason,

If you removed all metadata, how do you propose that ExifTool obtains these dates?  Try running this command to see what dates ExifTool has to work with:

exiftool -time:all FILE

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

If you renamed the files so that the date/time was part of the filename, you could use this.
exiftool "-AllDates<Filename" /path/to/files/

You might take a look at the system time stamps to see if they're correct
eexiftool -time:all -G1 -a -s /path/to/files/

If one of them is correct, most likely the FileModifyDate, then you could use this
exiftool "-AllDates<FileModifyDate" /path/to/files/

But other than that, no. Once the data is gone, it's gone.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

diffusefield

Quote from: StarGeek on November 12, 2024, 09:00:13 PMIf you renamed the files so that the date/time was part of the filename, you could use this.
exiftool "-AllDates<Filename" /path/to/files/

You might take a look at the system time stamps to see if they're correct
eexiftool -time:all -G1 -a -s /path/to/files/

If one of them is correct, most likely the FileModifyDate, then you could use this
exiftool "-AllDates<FileModifyDate" /path/to/files/

But other than that, no. Once the data is gone, it's gone.

Thanks for your feedback. Makes sense.

Quote from: Phil Harvey on November 12, 2024, 08:34:55 PMHi Jason,

If you removed all metadata, how do you propose that ExifTool obtains these dates?  Try running this command to see what dates ExifTool has to work with:

exiftool -time:all FILE

- Phil

Thanks, Phil. So, here's an example. Since there is probably no way to 'restore' the date, can I add a date?

For example, I have all of my photos in folders by year. Can I add 2022.01.01 00:00:00-00:00 to all of the one's from 2022 and so on?

If so, how do I do that?

File Modification Date/Time     : 2022:05:11 22:20:30-04:00
File Access Date/Time           : 2024:11:13 07:52:24-05:00
File Inode Change Date/Time     : 2024:10:20 00:38:29-04:00
    1 image files read
    1 files could not be read

Phil Harvey

This is the command to write this date to all files in a directory:

exiftool -alldates="2022:01:01 00:00:00" DIR

This will produce "_original" backups, but this may be avoided by adding -overwrite_original to the command.  Add -r to also process subdirectories.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

diffusefield