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
Only import numpy when necessary #5323
Conversation
And still adding an optional parameter to Color3DLut constructor disabling numpy usage might be perfect solution for those who want to stop using numpy within Pillow (for example if a buggy version installed in the system is out of their control). |
But that wouldn't help your situation, because you're not the one calling |
But for situations a 3rd party developer does call 3DLut but realizes numpy is buggy?
|
346b4f2
to
188d4f6
Compare
I'm not sold on the idea that Pillow should be adding workarounds for uncommon numpy bugs. That said, I am willing to accept that from an efficiency standpoint, it could be better for Pillow not to import numpy if it isn't actually going to be used. I've updated this PR, so that it now does a rudimentary check to see if |
Sounds great for me! Let me check it then, and I think we can mark the issue solved on Pillow side
|
@basilgello Hi! Have you checked this PR yet? If it's good we can include it in Thursday's release. Thanks! |
Yes, LGTM and is probably a low-risk change! Thanks for the heads-up!
|
The python-pillow update on 2021-04-23 fixed my issue with Kodi 19, but one day later python-numpy was updated and crashes started again. |
Let us know if you feel there is anything for us to do - but from discussion in #5320, I would think we've now done all we can. |
Resolves #5320
Moves
ImageFilter
numpy import into theImageFilter.Color3DLUT
constructor, so that numpy is not imported only to be unused.