hatobi / bereal-gdpr-photo-toolkit

Process BeReal photos received from a GDPR-request
The Unlicense
46 stars 6 forks source link

Add GPS data to JPEGs #1

Closed hatobi closed 7 months ago

hatobi commented 7 months ago

It's possible to add a location to BeReal-photos but as I never allowed the app to access my location, the GDPR export also does not contain location data. I'd guess that if you enabled this, the JSON should also come with this data which could then be added to the JPEGs. I'd be happy to implement it if someone could send me the data structure.

U14-dev commented 7 months ago

I requested my data just for this project :D Data Structure here

hatobi commented 7 months ago

Hey @U14-dev, I just implemented the functionality to copy geo location and captions. It's in the add-gps-data-branch. If you could try running it on your files and check for any errors, I'd be really glad!

U14-dev commented 7 months ago

Working for me i just needed to specify the encoding on the open json to get it running so i changed Load the JSON file to

with open("posts.json", encoding="utf8")

Edit: idk what exactly was wrong in my first test ( i had over 1k bereals so for test reasons i shortened my json) but utf8 should be default so normally there should be no need to specify but won't hurt to do so

hatobi commented 7 months ago

Thanks for your feedback @U14-dev. You're definitely right, it doesn't hurt to specify the encoding 😁 Just made some more changes to make the writing of metadata more robust and also tested it on a bunch more pictures with unusual characters in their captions, seemed to work just fine.