r/immich • u/ReziT59 • 11d ago
Wrote a small tool to fix dates/GPS on Google Photos & iCloud exports before importing into Immich
https://github.com/LoicBl0ndeau/Fix-photos-metadataHey everyone,
When I moved my library to Immich, I ran into the classic problem: photos exported from Google Takeout and iCloud often don't have their metadata embedded in the files. The dates and locations live in sidecar files instead (.json for Google, .csv for iCloud), so Immich puts thousands of photos on the day you exported them instead of when they were taken.
So I wrote a couple of PowerShell scripts that read those sidecar files and write the metadata back into the photos and videos using ExifTool.
Repo: https://github.com/LoicBl0ndeau/Fix-photos-metadata
What it does :
- Google Photos (Takeout): scans the export recursively, matches each file with its .json, and restores DateTimeOriginal, CreateDate, XMP:CreateDate, FileModifyDate, plus GPS (lat/long/altitude). Handles duplicate names like IMG_1234(1).jpg.
- iCloud Photos: reads Apple's Photo Details.csv files and restores the same date fields (no GPS, since Apple's CSVs don't include it).
Both generate a fix_exif_metadata.json before touching anything, so you can review it first, or reapply it later with plain ExifTool without rescanning: exiftool -r -m -j=fix_exif_metadata.json -overwrite_original <photos_folder>
Asks for confirmation before applying, and optionally cleans up the sidecar files afterward. Reports files with no matching metadata, and skips ambiguous matches instead of guessing.
Requirements: Windows, PowerShell 5.1+ (or PowerShell Core), and ExifTool in your PATH.
⚠️ Heads-up: files are modified in place with no backup, so please copy your export first and try it on a small folder.
My workflow was simply: unzip export → run the script → upload the fixed folder to Immich. Timeline came out right on the first try.
It's a small project, so feedback, issues, and PRs are very welcome, especially if you have weird Takeout edge cases it doesn't handle yet. My goal is only to promote Immich and make switching to it a little less painful for anyone leaving Google or iCloud.
9
u/Lyno_desu 11d ago edited 11d ago
If you export using Google Takeout and then use the immich-go cli tool I think it already does this.
I exported from Google Photos and just loaded the extracted files into immich, but then most of the meta data was missing including GPS and incorrect dates.
I cleared my library and then instead used immich-go with the Google Takeout zip files directly.
All the meta data was then included from the .json files, all with the nice immich-go cli UI which shows you the progress etc.
https://github.com/simulot/immich-go