This is similar to this question, except that the solution there doesn't work for me.
Viewing a HEIC file in Windows Explorer, I can see several dates. The one that matches what I know is the date I took the photo is headed 'Date' and 'Date taken'. The other dates aren't what I want.
I've tried two methods to get EXIF data from this file in Python:
from PIL import Image
_EXIF_DATE_TAG = 36867
img = Image.open(fileName)
info = img._getexif()
c.debug('info is', info)
# If info != None, search for _EXIF_DATE_TAG
This works for lots of other images, but for my HEIC files info is None.
I found the question linked above, and tried the answer there (exifread):
import exifread
with open(filename, 'rb') as image:
exif = exifread.process_file(image)
and exif here is None. So I wondered if the dates are encoded in the file in some other way, not EXIF, but these two tools seem to show otherwise:
http://exif.regex.info/exif.cgi shows: EXIF Site
So I'm thoroughly confused! Am I seeing EXIF data in Windows Explorer and these tools? And if so, why is neither Python tool seeing it?
Thanks for any help!
Windows 10, Python 2.7.16. The photos were taken on an iPhone XS, if that's relevant.
Update: Converting the HEIC file to a jpg, both methods work fine.