Time Shift of Jpeg Images

Cameras with different clock settings

As part of one of our recent trips, we were taking pictures with our phones, and our camera. Our camera had the date and time from the timezone we left, while our phones automatically updated. Once we got back, I wanted to organize all the pictures. Not only did I want them named similarly, but I want them in order and to have all the correct Exif data.

jhead Utility

To get this done, I used the jhead utility on linux written by Matthias Wandel (homepage).

Overall, it was very easy to do. I basically needed to:
  • Shift the EXIF timestamps of all the files by a fixed amount to account for the time difference
  • Change the file date to match the new EXIF timestamp
  • Rename the file using the timestamp in a format consistent with the other cameras
This directly translated into the following steps to process all of the jpeg files in the dir:

  • jhead -ta+6:59 *.JPG (shifts the time)
  • jhead -ft *.JPG (changes the file timestamp to match the EXIF timestamp)
  • jhead -n"%Y-%m-%d %H.%M.%S" *.JPG (renames the file using the timestamp)


That's it! Thanks Matthias for a great utility!

Last Modified: 07.11.09    Valid XHTML 1.0!    Valid CSS! Powered by Blogger