I can get the EXIF data from an image using PIL, but how can I get the date and time that the photo was taken?
Just calling ". getInfo()" on the ee. Date object will give you the number of milliseconds since 1970-01-01 in a Python dictionary.
EXIF: Date Time Original (i.e. when the photo was taken)When you take a photo, your digital camera records the date and time information in the actual image as EXIF (Exchangeable Image File Format) metadata. This happens automatically when you point and click.
Distinguished. Right click on the thumbnail photo and select 'Properties' - the details of dates will be displayed. Some photos will have 'Meta Data' - this will provide more information about the photo. Some photos have 'Geo tags' - for location where taken.
If you're using a Windows PC, right click the file and select 'Properties'. This will then display some of the EXIF data. If you're using a Mac, then right click and select 'Get Info'. These options won't show you all of the EXIF data though, but it'll show you the key bits such as settings used.
Found the answer eventually, the tag I needed was 36867:
from PIL import Image def get_date_taken(path): return Image.open(path)._getexif()[36867]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With