Copy the file date to EXIF

On my iPhone I make pictures using Darkroom Premium. Since I use this software and not the standard application the EXIF data is not stored in the pictures. Not having the GPS information is not such a big problem. But not having a date and time is!

In this specific situation the file date and time corresponds with the date and time at which the picture was taken. To correct this on my PC I use a script that copies the file date to some EXIF fields.
The script uses exiftool by Phil Harvey which is a brilliant piece of software when you want to manipulate the metadata of a picture

(1) "C:\Program Files\exiftool\exiftool.exe" "-FileModifyDate>CreateDate" *.jpg
(2) "C:\Program Files\exiftool\exiftool.exe" "-CreateDate>DateTimeOriginal" *.jpg
(3) "C:\Program Files\exiftool\exiftool.exe" "-CreateDate>ModifyDate" *.jpg
(4) "C:\Program Files\exiftool\exiftool.exe" "-CreateDate>FileModifyDate" *.jpg

Remarks:

C:\Program Files\exiftool\ is the location of exiftool.
*.jpg are the files that need to be updated.

First the file modify date (FileModifyDate) is copied to the EXIF field CreateDate (1).

Then theĀ  CreateDate is copied to DateTimeOriginal and ModifyDate (2 and 3).

By this changes the change date of the file is modified. Because of this this field (FileModifyDate) is restored again (4).

After the first copy action the field CreateDate is being used. This will not change during the script. The file date (FileModifyDate) will change with every operation. If you use this as “source” the EXIF fields will contain three different dates. You probably do not want this to happen ;-)

No related posts.

3 thoughts on “Copy the file date to EXIF

  1. Brilliant, that was just what I was looking for as a step to georeference some of my pictures.

    Thank you very much for publishing that!

    T/

  2. Just another thing I just tried:

    I copied the following lines into a notepad window:

    C:\exiftool_programme_path\exiftool “-FileModifyDate>CreateDate” .\*.jpg
    C:\exiftool_programme_path\exiftool “-CreateDate>DateTimeOriginal” .\*.jpg
    C:\exiftool_programme_path\exiftool “-CreateDate>ModifyDate” .\*.jpg
    C:\exiftool_programme_path\exiftool “-CreateDate>FileModifyDate” .\*.jpg

    (with exiftool_programme_path changed to where your exiftool is installed) and saved it as exif_date_mod.bat in the directory with the JPG files Ied want changed.

    Double-clicking the exif_date_mod.bat file in the file manager window ran through the whole process flawlessly and modified all JPG files according to Martin’s instruction in a single run without any further intervention.

    Thanks very much again, Martin!

    Thorsten

  3. Pingback: STRATER Log Batch Production HOWTO « Demolition Blog

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>