Search code examples
exiftool

How to merge JSON and Google Takeout Photos to get the right dates back?


I just got thousands of photos out of Google takeout but I can't seem to import them elsewhere in the right chronological order. I've also found some tutorials using exiftool but I can't get the different timezones right? Any idea how to retrieve the time with the correct timezone? The timezone isn't in the JSON either.


Solution

  • There are now many scripts and tools available that can extract the metadata from JSON files and apply it to the photos and videos:

    However, those scripts have limitations with regards to timezones, and to some pictures with a name that differs slightly from the name of the JSON file, e.g. PHOTO_NAME(1).jpg being confused with PHOTO_NAME.jpg(1).json. QuickTime- and PNG-specific tags aren't updated either.

    If you're happy with those limitations,

    • Install ExifTool
    • Replace the directory to process and run the command exiftool -r -d %s -tagsfromfile "%d/%F.json" "-GPSAltitude<GeoDataAltitude" "-GPSLatitude<GeoDataLatitude" "-GPSLatitudeRef<GeoDataLatitude" "-GPSLongitude<GeoDataLongitude" "-GPSLongitudeRef<GeoDataLongitude" "-Keywords<Tags" "-Subject<Tags" "-Caption-Abstract<Description" "-ImageDescription<Description" "-DateTimeOriginal<PhotoTakenTimeTimestamp" -ext "*" -overwrite_original -progress --ext json <DirToProcess>

    Otherwise, consider using a paid automated tool like https://metadatafixer.com/