Reading EXIF data from photo
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.
Check out the Photos module in the Pythonista documents. More specifically, photos.get_metadata.
You can use the included in PIL module:
_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.
Theoretically you could use the
stat()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. :)