Google Photo: Chronological Sequence of Images from Mixed Sources

On the road, I usually take pictures with an iPhone and a Nikon DSLR with a GPS -module attached. Back home, I will download image files from iCloud and the DSLR's flash card, process them, and have them uploaded into Google Photo using Google Backup & Sync.

After my last trip, however, the order of uploaded images in Google Photo seemed to be random instead of chronological. So I did analyse the problem and have devised a solution.


Problem

Google Photo uses the DateTimeOriginal value in the EXIF part to order images chronologically. You can create different orders when you arrange images in an album, but that's another step.

In addition to the DateTimeOriginal, GooglePhoto interprets the GPS location, if any, of images to determine the time zone and internally recalculate a universal DateTimeOriginal (it will display the unchanged EXIF DateTimeOriginal-value).

It turned out that some of my images simply had a wrong DateTimeOriginal (I adjusted the DSLR's internal clock a bit late), and others were lacking GPS data, which made Google Photo use GMT, hence two pictures with the same displayed DateTimeOriginal were spread by several hours in the sequence, with other images in between. So it's actually two problems: bad DateTimeOriginal and missing GPS data.

Solution

The Tool

I've used exiftool for all EXIF-data-fixes required to solve the above problems. The following assumes you know exiftool command line usage and just provides example command lines.

Part I : DateTimeOriginal

If you've discovered a DateTimeOriginal offset for several images, the fix is easy. Put those image files into a separate directory and execute exiftool there:
> exiftool -overwrite_original "-DateTimeOriginal+=0:0:0 2:0:0" "badTime/*.jpg"
Assumptions in this example: Time is 2 hrs off, and you want to correct all .jpg files in directory badTime, and you don't want to keep theGPS-less image files.

Note: if you are a user of the venerable Picasa image manager from Google (discontinued, but still working great), you can also use the 'adjust date and time...' feature in the 'Tools' menu to adjust DateTimeOriginal values of multiple pictures at once.

Part II : GPS data

It may by harder to determine the set of images that are misordered due to their (lack of) GPS data than the set that just has a bad Date/Time. So I suggest a two-step solution here:
  1. Separate bad from good
  2. Fix bad
The separation is easy; exiftool can a) check if there's relevant GPD data and b) move files around. Before you do that, there's some preparation required:
  • Create a directory named noGPS in your image directory
  • Use Google Maps to determine GPS coordinates for your images. There's no problem in setting the same value for all noGPS-images, but pick one in the correct timezone 😉
Then try this:
> exiftool -directory=noGPS -if "not $GPSLatitude" *.jpg
> exiftool -overwrite_original -GPSLongitudeRef=E -GPSLatitudeRef=S -GPSLongitude=144.965315 -GPSLatitude=37.821254 noGPS/*.jpg
Assumptions in this example: You've picked a spot in Melbourne VIC to assign your .jpg images to, and you don't want to keep theGPS-less image files.

Part III : Image Upload

Very important: do all of the above before uploading images to Google Photo. Fixing data later may not lead to a reordering. If you discover the mentioned problems after that, you should just delete the affected images from Google Photo, fix them locally, and upload again. Even if you use Google Backup & Sync.

And if you use Google Backup & Sync, make sure you move the image files that you want to process out of the reach of B&S, otherwise the deletion in Google Photo may be propagated to your local storage.

Have fun 📷 📱 💻

Kommentare