simulot / immich-go

An alternative to the immich-CLI command that doesn't depend on nodejs installation. It tries its best for importing google photos takeout archives.
GNU Affero General Public License v3.0
1.18k stars 35 forks source link

Same filename for different photos results in only one geolocation applied to all #286

Closed pasiphaegh closed 4 days ago

pasiphaegh commented 3 weeks ago

I have photos and scanned images (via iPhone camera) taken with different cameras over the years that had the same naming convention so there are some naming collisions, e.g. IMG_8912.JPG for 2 different photos. When uploading to immich via immich-go, it seems one of the photo's geolocation tags are applied to all of the photos of the same name.

I first noticed this when my childhood photos from Melbourne, Victoria (Australia) that I 'scanned' by taking a photo with my iPhone were showing their geolocation on the other side of the world as Jelenia Góra, Poland. After searching for the filename in Google Photos, I discovered there were two photos with the same name and one of them was from Poland. The latest file from my holiday to Poland in 2015 had overwritten my childhood photo's geolocation and had been applied to both photos.

Is there a way to discern the difference between photos with the same name that are not duplicates? They should each have their own EXIF tags written independently. Thanks :)

I love immich-go. It's so good... thank you!

simulot commented 3 weeks ago

I love immich-go. It's so good... thank you!

Thank you for your nice comment! Immich-go passes the photos to Immich without any modification to the file.

With Google Photos takeout, it takes the date of capture from the JSON file associated to the photo. Immich extract the coordinates from EXIF data.

Have you used a takeout? Have you processed all parts of the takeout together?

Is there a way to discern the difference between photos with the same name that are not duplicates? They should each have their own EXIF tags written independently.

Correct. Could you check the photos localisation in IPhotos, then in Google Photos, and check the files in the archive?

pasiphaegh commented 3 weeks ago

Thanks for the quick reply!

Google Takeout Yes, I'm using a Google Takeout. I downloaded my photos and videos in .tgz files and then extracted them into a temporary directory, which created subdirectories as needed. I asked immich-go to source the photos and videos from that temporary folder. The extracted files contain photo files, video files and corresponding JSON files. You can see the upload stats at the top of this screenshot during the upload: image

Example of geolocation/GPS issue Here is an example of where I have a few files of the same filename and all of their geolocation/GPS coordinates are the same in immich when they shouldn't be, as they have all been set to Poland. I have come across many of these:

brian:~/Pictures/tmp/Takeout/Google Photos$ find . -name IMG_8912.JPG ./2015-08 Poland trip/IMG_8912.JPG ./Photos from 2017/IMG_8912.JPG ./Photos from 2015/IMG_8912.JPG ./1980-1990 Photo albums 1 and 2/IMG_8912.JPG ./Trip to Poland/IMG_8912.JPG

Google Photos: Are the geolocations of the photos in Google Photos (online service) ok? I searched in Google Photos for the same image filename, IMG_8912.JPG, and it showed me the photos I was expecting. I opened each one, clicked on the info symbol and checked its geolocation. Each of the photos has a unique location and it is correct for where the photos were taken. Some map to Poland and others map to Melbourne, Australia, which is correct.

Google Takeout: Are the geolocations in the extracted JSON files in the tmp folder ok? I then checked the extracted files in the tmp folder to see if Google Takeout had somehow extracted the GPS coordinates incorrectly. However, they are all correct. Here is an example:

They have different GPS coordinates and they are correct for where I took the photos. I've hidden the exact location for privacy.

Since I've confirmed that this is not an issue in Google Photos or Google Takeout, is this an issue in immich-go or immich?

simulot commented 3 weeks ago

I assume you have used the -google-photos option.

Can you check the exif data embedded in the image with exiftool (or similar)? immich server don't use another source for GPS.

Can you privately share a make up takeout archive with all samples of a same photo name (photos and json), and respecting the folder structure? You can send it to my discord account @simulot

m1ndy commented 5 days ago

Would love to get this fixed as same-filename but different photo is a constant issue when using cameras like DSLRs/Drones that reset their filename counter to 0 every session.

Is there any update, @simulot ?

simulot commented 5 days ago

It seams that the problem is in the immich server. Immich-go just push photos and immich-server uses the exif information to get GPS coordinates.

pasiphaegh commented 4 days ago

Apologies! I've been away on holidays and just coming back to this now.

I should have closed this issue and opened it under the immich server's issue page. @simulot and I worked through this and discovered it was not an issue with immich-go.

There is another issue that we found related to album creation, which we think may be an immich-go issue: Google Takeout albums not being recreated faithfully. However, we haven't explored this much to confirm and I haven't seen anyone else report it. I'll do some more testing and if it's a real issue or just something with my setup. If so, I'll raise it separately to this one.

I'll close this issue and raise this under the immich server's issue page.