pi3d / pi3d_demos

Demos and support files for pi3d (3D graphics python package for the raspberry pi)
Other
71 stars 33 forks source link

Added text size argument and geolocation support #29

Open sergon2000 opened 4 years ago

sergon2000 commented 4 years ago

The default text size was a bit too small for me so I've added a text size argument. Let me know if that makes sense, thanks!

sergon2000 commented 4 years ago

Hi!

I’ve added another commit to this PR, I hope you guys don’t mind about these changes, feel free to accept or reject this PR. The script is awesome but I felt something was missing, basically the ability to show more information other than the file name. So I added the taken date and I thought it’d be nice to show the location as well.

For this feature to work, the photos should be geotagged. So we can extract the latitude and longitude from photos but how can we show the location in a nicer way? It’s necessary to use an external provider and the best one is Google. The process is simple: we convert the geotagging information to decimal degrees and pass it to Google, then the result from Google is processed (its response is pretty large).

Keep in mind that this service is not completely free, I think there is a free monthly amount of requests. If you reach that they start charging you, not very expensive though. To avoid extra charges and minimize the number of requests, the locations are stored in a local text file so there will be only one request per photo.

The following arguments have to be configured:

Other than that, there is also a small improvement in the get_exif_info method when fetching the exif data.

Let me know if you have any question, thanks!

paddywwoof commented 4 years ago

Sergio, that's great, thanks. I will put the text size in but I'm not sure what's the best way of adding extras that some people might use but not others. There have been a couple of really cool additions that people have worked out but the file is already a bit chaotic as it keeps having bits added.

Anyway, I will definitely do the get_exif_info() improvement. Just need to decide how to reference or include all the 'optional' ideas...

paddywwoof commented 3 years ago

Sergio, thanks so much for your input on this. I've included a lot of your code in the latest release but modified somewhat to incorporate some other factors. The text to show has become a binary mask 00001 for name 00010 for date 00100 for location etc (actually only three at the moment but could be extended) I've also had to make the TextBlock string multi-line and wrapping.

In the end I couldn't fight my way through googles cloud control panel. I've used it for various things in the past but it's got beyond complicated - as with AWS I think it can only really be navigated by full time cloud facing developers! So I used geopy.

All the best

Paddy