how to correct exif date time in files which have the same date?

Started by tom231, August 05, 2010, 04:59:53 AM

Previous topic - Next topic

tom231

I've ca. 50 images with the same exif date and time. Now I want to change section time as below:

filename yyyymmdd-hhmmss  convert to
a1.jpg   20100101-102030   -->>   a1.jpg  20100101-102031
a2.jpg   20100101-102030   -->>   a2.jpg  20100101-102032
a3.jpg   20100101-102030   -->>   a3.jpg  20100101-102033

is it possible with exiftool?

Phil Harvey

The exiftool application can't do this, but with a bit of Perl scripting this would be easy to do using the ExifTool API.

- 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 ($).

tom231

I have no idea how to use Perl scripting  :(
so maybe there is another tool which I could use to correct section time?

Phil Harvey

I know of no tool that can do this.

An alternative is to use some software (a spreadsheet perhaps?) to generate the exiftool commands necessary to do what you want and write them to a batch file then run this from the command line.

- 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 ($).

foxylady337

I expect you've solved your problem by now, but here is a simple shell script I used to solve a similar problem in case someone else is passing this way:

exiftool -DateTimeOriginal="1963:01:01 11:59:59" IMG0-1.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:00" IMG000.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:01" IMG001.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:02" IMG002.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:03" IMG003.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:04" IMG004.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:05" IMG005.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:06" IMG006.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:07" IMG007.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:08" IMG008.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:09" IMG009.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:10" IMG010.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:11" IMG011.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:12" IMG012.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:13" IMG013.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:14" IMG014.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:15" IMG015.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:18" IMG018.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:19" IMG019.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:20" IMG020.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:21" IMG021.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:22" IMG022.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:23" IMG023.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:24" IMG024.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:24" IMG024_modified.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:25" IMG025.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:26" IMG026.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:27" IMG027.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:28" IMG028.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:29" IMG029.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:30" IMG030.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:31" IMG031.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:32" IMG032.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:33" IMG033.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:34" IMG034.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:35" IMG035.jpg
exiftool -DateTimeOriginal="1963:01:01 12:00:36" IMG036.jpg


I've been cataloguing a large collection of images using Shotwell and found that the scans I'd made of a 35mm film taken in 1963 weren't showing up as an "event" as I'd expected.

After I'd tested the first line as a command in its own right, and confirmed that DateTimeOriginal had been set appropriately, I sent a directory listing to a file using...

ls >temp.txt

... and then edited the file to add the commands for each file, and remove any irrelevant filenames.

I have my films indexed as 1960-01, 1960-02 etc, and use the numbers in the margins of the negatives to label the image files - so IMG001.jpg, IMG002.jpg etc. will be saved in a subdirectory named for that film name (e.g. ./Coolscan/1960-01, ./Coolscan/1960-02 etc).

Occasionally an image is on negative 0, or less, so I have set the time at noon for IMG000.jpg of film 1963-01 thus:

exiftool -DateTimeOriginal="1963:01:01 12:00:00" IMG000.jpg

This way I can use "1963:01:01 11:59:59" (one second earlier!)  for the image that precedes IMG000.jpg, which I have labelled IMG0-1.jpg.

Obviously, the dates don't really match the dates of the original photographs, but the objective of having them catalogued in chronological order has been achieved.

I'm sure that a few hours of bashing the perl manual would enable me to do the whole thing much more elegantly...