Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open webp image: UnidentifiedImageError #5147

Closed
rgoubet opened this issue Dec 28, 2020 · 3 comments
Closed

Cannot open webp image: UnidentifiedImageError #5147

rgoubet opened this issue Dec 28, 2020 · 3 comments
Labels
Anaconda Issues with Anaconda's Pillow WebP

Comments

@rgoubet
Copy link

rgoubet commented Dec 28, 2020

On an Anaconda distribution, after installing the libwebp package and pillow, I cannot open a webp file (e.g. the test.webp file from the libwebp library).

In [1]: from PIL import Image

In [2]: img = Image.open('test.webp')
C:\Users\user\anaconda3\lib\site-packages\PIL\Image.py:2942: UserWarning: image file could not be identified because WEBP support not installed
  warnings.warn(message)
---------------------------------------------------------------------------
UnidentifiedImageError                    Traceback (most recent call last)
<ipython-input-2-79ee787a81b3> in <module>
----> 1 img = Image.open('test.webp')

~\anaconda3\lib\site-packages\PIL\Image.py in open(fp, mode, formats)
   2941     for message in accept_warnings:
   2942         warnings.warn(message)
-> 2943     raise UnidentifiedImageError(
   2944         "cannot identify image file %r" % (filename if filename else fp)
   2945     )

UnidentifiedImageError: cannot identify image file 'test.webp'

Looks like Pillow/libwebp aren't properly set up on the Anaconda packages.

@hugovk
Copy link
Member

hugovk commented Dec 28, 2020

This works for me with https://github.com/webmproject/libwebp/blob/master/examples/test.webp on Mac with the 8.0.1 wheel from PyPI:

>>> from PIL import Image
>>> im = Image.open("test.webp")
>>> im
<PIL.WebPImagePlugin.WebPImageFile image mode=RGB size=128x128 at 0x1096EED00>
>>> im.show()
>>>

Does the same thing happen for you with any webp file? And with https://github.com/python-pillow/Pillow/blob/master/Tests/images/hopper.webp?

If so, we don't create or maintain the Anaconda packages here, you might be best reporting at https://github.com/conda-forge/pillow-feedstock

@hugovk hugovk added the WebP label Dec 28, 2020
@rgoubet
Copy link
Author

rgoubet commented Dec 28, 2020

OK, thanks, I'll report it in that feed.

@rgoubet
Copy link
Author

rgoubet commented Dec 28, 2020

Resubmitted here.

@rgoubet rgoubet closed this as completed Dec 28, 2020
@aclark4life aclark4life added the Anaconda Issues with Anaconda's Pillow label May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Anaconda Issues with Anaconda's Pillow WebP
Projects
None yet
Development

No branches or pull requests

3 participants