Need some help on my way out of google photo

Started by w0uf, December 16, 2023, 05:27:18 PM

Previous topic - Next topic

w0uf

Hello,

I'm trying to go out of google photo but it's not an easy task and I have a 1TB+ library on it (I pay for keeping original - not compressed - version of my photos).

I learned that using the API I will get my photo in original quality but without EXIF data.

After some digging on github I found this tool : https://github.com/perkeep/gphotos-cdp/ and this documentation : https://msfjarvis.dev/posts/backing-up-your-content-from-google-photos/. I cloned the fork and did some modifications so it can handle large libraries. It's now up and running, my collection will soon be completly downloaded and kept in sync.

The next step was to find a tool to preview and manage my photos that will allow me to keep it synced with our phones like google photo. I choosed Immich which is very easy to setup with docker. It's actually monitoring the synced google photo library to create thumbnails of everything and show them in a nice UI (close to google photo one), it will take a few days I think but it's ok for this first run.

I though that after these 2 steps everything will be OK but no. Most of the photo are ok but I have a lot (1000+) of old photos imported into Immich that are placed in the timeline at the date I synced them from google photo and not when the picture was taken. After checking them : no exif data.

Part of these photos (60%) have a "date" filename so I had the idea of editing the exif thanks to the filename and after some digging I found Exiftool  8)

I would like to run a command over my whole collection that will do exactly this :

"If none of DateTime, DateTimeDigitized and DateTimeOriginal is setted and if the file name is exactly "YYYY-MM-DD HH:MM:SS.jpg" then update DateTime, DateTimeDigitized, DateTimeOriginal from filename"


I don't want :
- to alter photos with correct pattern but where exif data is correct
- to alter photos without exif data but with an other filename pattern

(I am also digging to create an XMP file along each of these incorrectly dated files as an alternative because Immich seems to understand them)

For the other 40%, it's mostly files named "IMG_XXX" without any date, I will maybe try to get the date from google api for them because it looks like ok on their side (they at least had the upload date).

Thank you for your help.

Phil Harvey

Something like this I think:

exiftool -if "$filename=~/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\./ and not $alldates" "-alldates<filename" DIR

AllDates is a shortcut for DateTimeOriginal, CreateDate and ModifyDate, so the -if statement will test all 3, and the command will set all 3 from matching filenames if none of them existed beforehand.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

w0uf

Thank you very much.

I'll copy a subset of my collection and try this.