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

Unhelpful error if libwebp is not installed #2309

Closed
khazhyk opened this issue Dec 25, 2016 · 4 comments
Closed

Unhelpful error if libwebp is not installed #2309

khazhyk opened this issue Dec 25, 2016 · 4 comments
Labels
Bug Any unexpected behavior, until confirmed feature. Enhancement
Milestone

Comments

@khazhyk
Copy link

khazhyk commented Dec 25, 2016

What did you do?

Tried to open a webp file.

What did you expect to happen?

The webp file opened, or PIL would notify me that it was compiled without webp support.

What actually happened?

Got generic 'OSError: cannot identify image file'

What versions of Pillow and Python are you using?

Python 3.5, Pillow 3.4.2

Judging by #1930 a more specific error doesn't seem unreasonable, and could speed up troubleshooting for others in the future.

@aclark4life
Copy link
Member

@khazhyk Can you send a pull request with the changes you want? Also what platform did you install on? I know that if you compile Pillow you'll see webp missing… but maybe you installed a pre-built wheel.

@khazhyk
Copy link
Author

khazhyk commented Dec 26, 2016

I had installed (not from wheel) a while ago and just so happened to recently to start using webp.

From what I understand by the code, a plugin will fail to import (and register) if the native extension isn't compiled (and logs to debug), which means by the time we reach open() we can't distinguish between something that matches no plugins and something that would match a plugin if it's native portion had been compiled. It seems like that could be changed to allow for that, although I don't fully understand PIL's design or rationale for what implications that would have.

@aclark4life aclark4life added the Bug Any unexpected behavior, until confirmed feature. label Jan 8, 2017
@aclark4life aclark4life added this to the Future milestone Jan 8, 2017
@radarhere radarhere changed the title Unhelpful error if libwebp is not installed. Unhelpful error if libwebp is not installed Sep 22, 2017
@radarhere
Copy link
Member

I've created a PR as a possible solution to this.

@hugovk
Copy link
Member

hugovk commented Sep 30, 2018

Fixed by #3169.

@hugovk hugovk closed this as completed Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Any unexpected behavior, until confirmed feature. Enhancement
Projects
None yet
Development

No branches or pull requests

5 participants