This script processes Google Takeout JSON metadata files and renames them to be compatible with exiftool syntax. It prepares your metadata files for batch processing to embed photo metadata (EXIF data, GPS information, timestamps, descriptions, etc.) back into your image files.
Google Takeout exports metadata in JSON format alongside your photos and videos. However, these JSON files often have naming conventions that don't work well with exiftool. This PowerShell script renames the JSON files to the proper format that exiftool expects, enabling you to automatically transfer metadata from JSON files to your image files.
-
Run the PowerShell script on your Google Takeout directory:
.\rename_gtakeout_json.ps1 -TargetDirectory "C:\Google\takeout\"
-
After the script completes, use the following
exiftoolcommand to apply the metadata to your images:
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" "-FileCreateDate<PhotoTakenTimeTimestamp" "-FileModifyDate<PhotoTakenTimeTimestamp" -overwrite_original -progress --ext json "C:\Google\takeout\"- PowerShell 5.0 or later
- exiftool installed and available in your system PATH
- Always backup your original files before running the exiftool command with
-overwrite_original - The script and exiftool command work best on photo directories from Google Takeout
- Supported metadata includes GPS coordinates, timestamps, descriptions, keywords, and more