Shifting TimeOriginal by one sec per picture in a folder

Started by Speer, May 07, 2011, 08:29:48 AM

Previous topic - Next topic

Speer

After some years of waiting my collection is now scanned and digitalized. As a result I am confronted with over 5000 jpg files. So far the files provide no information regarding Exifs TimeOriginal which e.g. Picasa uses to sort pictures. My idea / aim is, to "provide" every set of e.g. 50-100 pictures with the original / same year-month-day Exif information, e.g. 1982-03-01. For example the beginning of the holidays. Using ExifTool this is an easy task - thank you. However, I have search many groups and could not find out how I would solve the task at hand. Having 50 pictures, numbered in the order they should appear / they have taken place or what ever, e.g. Easter_Holiday_1982_(001), Easter_Holiday_1982_(002) etc. All pictures have the same Exif TimeOriginal information, e.g. 1982-03-01 00:00:00. Now I would like that the numbering of the files matches e.g. the seconds / minutes in the exif data. As a result the pictures are in the right order in Picasa and other equivalent tools. Any idea welcome  :) Thanks a lot.

Alan Clifford

First thoughts:

Given the images would be in the right order with a directory listing, a workable hack perhaps would be a shell script that looped around the file names in that order and then use exiftool to add a second for each one. 

In bash it would be something like


ctr = 1
for IMAGE in `ls`
do
# exiftool to add ${ctr} seconds to datetimeorginal in ${IMAGE}
ctr=${ctr+1}
done


Presumably you could do something similar in a .bat file if that is what you use?

Alan


Phil Harvey

Hi Alan,

What you have suggested would work.  The exiftool command would look like:

exiftool -datetimeoriginal+="0:0:${ctr}" "${IMAGE}"

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