Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Reading EXIF data from photo
-
Hi,
I plan to write a simple app that puts a datetime stamp to a photo based on its EXIF data. So far I haven't found a way to read the EXIF data, especially using Pythonista. Can anybody give me a light on this? Thank you.
-Bee
-
Check out the Photos module in the Pythonista documents. More specifically, photos.get_metadata.
-
You can use the included in PIL module:
http://stackoverflow.com/questions/4764932/in-python-how-do-i-read-the-exif-data-for-an-image
Note that
_getexif()
attribute might not exist if you opened a gif or png. Threw me off when I first tried this, since apparently screenshots in ios are taken as png, but named jpg, and that's what I had lying around in my pythonista folder. -
If the photo doesn't have exif data, can I take the data from the file info e.g. datetime of file creation? Is there any python function to read it? Not the datetime of last file modification but the true file creation.
Thank you.
-
Theoretically you could use the
os
module'sstat()
function to check the creation date, though I don't know if it is accurate with photos imported from the camera roll. -
Code from your filenav would make it easy to do some experiments.
-
Did you look at this yet?
-
Thank you for providing link to other projects. filenav seems pretty cool. I'll start with that. :)