Piexif icon indicating copy to clipboard operation
Piexif copied to clipboard

Possible addition of HEIC file type?

Open thatcomputerguy0101 opened this issue 5 years ago • 2 comments

I was wondering if it would be able to add HEIC as a supported file type for this library since HEIC files also have embedded EXIF data. I'm not sure if it helps, but here is a js library for reading the data.

thatcomputerguy0101 avatar Jul 25 '20 20:07 thatcomputerguy0101

Hey, @hMatoba, are there any chances this will ever be done?

My script depends on this library, but people want to have .heic support, and I don't know whether to change the library or what...

TheLastGimbus avatar Jan 29 '21 20:01 TheLastGimbus

You can do

# pip install piexif pillow pillow-heif
import piexif
from PIL import Image
from pillow_heif import register_heif_opener

register_heif_opener()

with Image.open(path) as img:
    if "exif" in img.info:
        exif = piexif.load(img.info["exif"])

Dobatymo avatar Jun 30 '23 00:06 Dobatymo