Short Tip: Changing the original time of a photo at cli level

920839987_135ba34fffSometimes it happens that you take photos with a camera, and realize right in the middle of your session that the time of the camera is totally offset. In such cases: just keep taking photos and make sure that you take a photo of a clock at some point. You can correct the time stamps later on in the shell, even processing multiple images at once.

Afterwards, download the images, check the actual time offset by comparing the photographed clock and the time and date given in that image, and use exiftool to correct the time stamps of the photo. For example, imagine you have to change the time by adding two hours and fifteen minutes, the cli command is:

$ exiftool -AllDates-='2:15' *.JPG

You can check the actual date of the image either by the usual GUI programs or on command line:

$ exiftool MyImage.jpg|grep Time
File Modification Date/Time     : 2011:11:03 13:00:39+01:00
Exposure Time                   : 1/100
Date/Time Original              : 2009:09:05 07:07:49

If you have to process a batch of pictures, you can just wrap a for loop around the command.

About these ads

3 thoughts on “Short Tip: Changing the original time of a photo at cli level

Comments are closed.