Taking the guide from ExifRead 3.0.0 which says that it can deal with HEIC images, and with the examples of How to work with HEIC image file types in Python, I tried to read metadata of a HEIC file:
p = Path(r'C:\Users\Admin\Pictures\Apple media files\gallery\202204')
l=list(p.glob('**/*.HEIC'))
print(l[0])
# Open image file for reading (must be in binary mode)
f = open(l[0], 'rb')
# Return Exif tags
# tags = exifread.process_file(f)
# tags
exifread.process_file(f)
C:\Users\Admin\Pictures\Apple media files\gallery\202204\IMG_1234.HEIC
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
c:\Users\Admin\anaconda3\envs\scrape\lib\site-packages\exifread\heic.py in get_parser(self, box)
170 try:
--> 171 return defs[box.name]
172 except (IndexError, KeyError) as err:
KeyError: 'hdlr'
The above exception was the direct cause of the following exception:
NoParser Traceback (most recent call last)
in
9 # tags
10
---> 11 exifread.process_file(f)
c:\Users\Admin\anaconda3\envs\scrape\lib\site-packages\exifread\__init__.py in process_file(fh, stop_tag, details, strict, debug, truncate_tags, auto_seek)
135
136 try:
--> 137 offset, endian, fake_exif = _determine_type(fh)
138 except ExifNotFound as err:
139 logger.warning(err)
c:\Users\Admin\anaconda3\envs\scrape\lib\site-packages\exifread\__init__.py in _determine_type(fh)
...
--> 173 raise NoParser(box.name) from err
174
175 def parse_box(self, box: Box) -> Box:
NoParser: hdlr
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...
How to reach the metadata of HEIC files with the "exifread" Python module?