bigcat88 / pillow_heif

Python library for working with HEIF images and plugin for Pillow.
BSD 3-Clause "New" or "Revised" License
209 stars 16 forks source link

iOS18 HEIC photo open failed #249

Closed Jraaay closed 2 months ago

Jraaay commented 3 months ago

Describe the bug

When opening a photo shot by an iOS 18 device, will get an error: 'Invalid input: Unspecified: Metadata not correctly assigned to image'.

Steps/Code to Reproduce

from PIL import Image
from pillow_heif import register_heif_opener

register_heif_opener()

Image.open("path_to_img").show()

IMG_6849_1.zip

Expected Results

Open image successfully

Actual Results

PIL.UnidentifiedImageError: cannot identify image file 'path_to_img'

Versions

3.12.0 | packaged by Anaconda, Inc. | (main, Oct  2 2023, 17:20:38) [MSC v.1916 64 bit (AMD64)]
Windows-11-10.0.22631-SP0
0.16.0
{'libheif': '1.17.6', 'HEIF': 'x265 HEVC encoder (3.4+31-6722fce1f)', 'AVIF': 'AOMedia Project AV1 Encoder v3.8.2', 'encoders': {'x265': 'x265 HEVC encoder (3.4+31-6722fce1f)', 'aom': 'AOMedia Project AV1 Encoder v3.8.2', 'mask': 'mask'}, 'decoders': {'libde265': 'libde265 HEVC decoder, version 1.0.15', 'aom': 'AOMedia Project AV1 Decoder v3.8.2'}}
bigcat88 commented 3 months ago

Thank you for reporting this, can not promise fix to arrive soon, as it will require new version of libheif to be published.

Reference: https://github.com/strukturag/libheif/issues/1190

tharunkumartk commented 2 months ago

Is it possible to create a new release with this fix ASAP? This update in libheif is necessary for users with iOS18, and it is a breaking change.

bigcat88 commented 2 months ago

Release is planned for tomorrow or a day after.