monogram with initials UKR

Bulk correct skewed timestamps on photos using exiftool

Updated: Under: projects Tags: #photography

I got my wedding pictures, a folder with a set of JPEG’s taken from a bunch of cameras. I was happy, but annoyingly when looking at the photos chronologically as it’s clear some have wrong timestamps causing the order to be out of whack.

Random photo running around with the Ricoh GR in Kandy
Random photo running around with the Ricoh GR in Kandy

Let’s fix it up with exiftool! On macOS, you can easily get it installed using brew.

brew install exiftool

Figuring out what went wrong

I knew instinctively that it must be a wrong time setting on a camera. I do it myself at times, when the camera boots up, and you quickly punch in a date and a time.

I first need to take stock of all the images, specifically the

  • File name
  • Serial number (unique camera identifier)
  • Taken timestamp
exiftool -T -FileName -SerialNumber -DateTimeOriginal -ext jpg .

Then after manually relating a couple of photos, I found the culprit! One camera which had a time-delta of 11 hours, yikes!

Offsetting the timestamp

Now that I know the serial number of the camera and the required to be offset to fix the discrepancy, we can use exiftool to fix it.

exiftool -if '$SerialNumber eq "7601644"' "-AllDates+=11:54:09" -ext jpg .

Using the -if switch I’m able to filter out one serial number. You can get rid of this if you can apply to all images.

Removing the original backups

You would have noticed that there are original files left by exiftool, which can be used to revert any blunders. You can remove the original backups using the following command.

exiftool -delete_original .