Skip to content

Read metadata from Google Photos takeout#477

Draft
abb128 wants to merge 1 commit intoblissd:mainfrom
abb128:main
Draft

Read metadata from Google Photos takeout#477
abb128 wants to merge 1 commit intoblissd:mainfrom
abb128:main

Conversation

@abb128
Copy link
Copy Markdown
Contributor

@abb128 abb128 commented Aug 2, 2025

This PR improves the experience of Fotema when using a Google Photos Takeout directory as a photo library.

The files all have the same file creation/modification date of when you initiated the export. Although most photos will still have the real creation date in EXIF it's not always there (e.g. PNGs, edited images). This can lead to a disorganized library.

Google Photos stores the actual creation date in a nearby json file which we can use instead.

Some TODOs that I'd like help or guidance with:

  • Option to toggle this on or off? Though I'm not sure a reason someone would want this turned off, so it could just be left as-is
    • If we decide to make an option, it will need to re-scan all image metadata when it's toggled
    • Otherwise I assume we can just bump photo::metadata::VERSION and video::metadata::VERSION to force a re-scan on existing installs?
  • Currently if metadata is there, it will override what was read from EXIF. I think they should basically always match but we could instead prioritize EXIF and only use Google metadata when the EXIF fields are blank

Nice-to-haves that could be added:

  • GPS coordinates for videos, it's not super critical but since the data is there we could add it so it appears on the map. The video metadata struct currently lacks a GPS coordinate field
  • The metadata can also contains peoples names, "people": [{"name": "Joe"}], could be useful for the People gallery

@abb128 abb128 changed the title = Google Photos takeout Read metadata from Google Photos takeout Aug 2, 2025
@blissd
Copy link
Copy Markdown
Owner

blissd commented Aug 3, 2025

Hi @abb128. Thanks for your PR. On paper, this is a feature I'd like. I personally use Ente and the ente-cli to get photos from my phone to my Linux laptop and tablet and it also produces metadata files, though I haven't done the research to see how compatible they are with Google checkout metadata files.

I'll take a good look at this PR soon and give you some feedback.

@blissd
Copy link
Copy Markdown
Owner

blissd commented Aug 6, 2025

Hi @abb128.

To respond to your questions:

  1. Yes, the metadata version constants should be incremented to force a re-scan of all photo and video metadata. This would cause the Google takeout metadata to be saved to Fotema's database, and then the view_info side panel would not need to also enrich the file metadata.
  2. I don't think there should be an option to turn this feature off, as long as the enrichment process is fast, accurate, and reliable. If there was a toggle for the feature, then some thought would need to be put in to figure out the behaviour when the on/off option is toggled and some work put in to rescan all file metadata without incrementing the metadata version. I think there is some value in Fotema being able to re-scan all file metadata (as I know that for at least one user there was confusion when they edited a file's metadata and the change wasn't reflected in Fotema), but I don't think that needs to be part of this PR.
  3. I don't know enough about Google takeout to judge if the EXIF or takeout values should take priority, but I lean towards the takeout metadata as I assume it will contain any user changes to the metadata. If you edit a photo in Google photos to fix, say, the GPS coords, do the updated coordinates only appear in the takeout metadata?
  4. I would like GPS coords in videos and to display them on the photo map, but that is probably a bigger job and doesn't need to be in this PR. I have an issue (Put videos on the map #87) for this... but don't if or when I will get to it.

Thanks for taking the time to look at supporting Google takeout!

@blissd
Copy link
Copy Markdown
Owner

blissd commented Aug 7, 2025

I have added a videos_geo table so you can add video GPS coordinates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants