Fixing (some) photo timestamps in a folder


Having just gotten back from a vacation with 2 different cameras along, I was dismayed to learn that they didn't agree on the date - a 10h difference! The end result was a strange and disconcerting time-travelling slideshow - something had to be done! I rolled up my sleeves, got ready to write a long and complex perl script to fix the timestamps, and shortly discovered that the solution is a one-liner using exiftool (which does use Perl under the hood).

I found this great summary in the official documentation, but it unfortunately assumes there's only one camera involved. I had to create a working folder and take a few extra steps. Specifically:

  1. create a temporary working folder. I called it "working", because I'm crazy like that.
  2. copy only the files that needed fixing into that folder.
  3. run the command:
    • exiftool -AllDates+=10 ./working/
  4. verify that the dates are correct/make sense now.
  5. Remove the extra "_original" files that were created. There are command line flags to simplify this, but I like backups.
  6. move the modified files back to their original location, overwriting as needed.

Tada, sequential photos! I then had to go into digikam and convince it to re-read the metadata - silly GUI tools.