bigcat88 / pillow_heif

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

AttributeError: module 'PIL.ImageFile' has no attribute 'PyEncoder' #250

Closed qgbcs closed 4 months ago

qgbcs commented 4 months ago

Describe the bug

AttributeError Traceback (most recent call last)

in ----> 1 pil.read_heic(r'C:\test\!\IMG_0220.HEIC') //192.168.1.3/C/QGB/babun/cygwin/bin\qgb\pil.py in read_heic(f) 558 register_heif_opener() 559 --> 560 image = Image.open(f) 561 return image C:\QGB\Anaconda3\lib\site-packages\PIL\Image.py in open(fp, mode, formats) 2930 msg = "Width and height must be >= 0" 2931 raise ValueError(msg) -> 2932 2933 return True 2934 C:\QGB\Anaconda3\lib\site-packages\PIL\Image.py in init() 404 try: 405 # get decoder --> 406 decoder = getattr(core, decoder_name + "_decoder") 407 except AttributeError as e: 408 msg = f"decoder {decoder_name} not available" C:\QGB\Anaconda3\lib\site-packages\PIL\BlpImagePlugin.py in 416 417 --> 418 class BLPEncoder(ImageFile.PyEncoder): 419 _pushes_fd = True 420 AttributeError: module 'PIL.ImageFile' has no attribute 'PyEncoder' ### Steps/Code to Reproduce from pillow_heif import register_heif_opener register_heif_opener() image = Image.open(f) ### Expected Results read ### Actual Results can not read ### Versions ```shell 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] Windows-10-10.0.19041-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 4 months ago

What version of Pillow?

qgbcs commented 4 months ago

PIL.version '8.0.1'

bigcat88 commented 4 months ago

I don't know how you installed pillow_heif 0.16.0 as it requires Pillow version >=9.5.0.

I can only recommend updating Pillow to the latest version or at least 9.5.0