-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
AttributeError: tobytes
on img_pil Image provider
#5460
Comments
Another way to reproduce is to install pip and run
Without installing PIL I get all tests passing, same as when installing Pillow; |
Here's the pull request that fixes the issue: #5461 |
AndreMiras
added a commit
to AndreMiras/PyWallet
that referenced
this issue
Oct 29, 2017
AndreMiras
added a commit
to AndreMiras/PyWallet
that referenced
this issue
Oct 29, 2017
KeyWeeUsr
added a commit
that referenced
this issue
Nov 1, 2017
…buteError_tobytes Monkey patch PIL frombytes & tobytes, fixes #5460
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Versions
pip install Kivy==1.10.0
Description
In kivy/core/image/img_pil.py, both
ImageLoaderPIL._img_read()
andImageLoaderPIL.save()
would fail withAttributeError
if running PIL rather than Pillow.I know PIL is deprecated in favor if Pillow, but we still have no recipe for Pillow (kivy/python-for-android#786) and we try to import PIL first so it means we want to support both. And by the way I would do the other way around, i.e. import Pillow first and fallback on PIL.
Code and Logs
Here is the
demo.py
code I'm using to reproduce:Debug session
First session
The first session is simply with
Kivy==1.10.0
installed and running the code works perfectly since the loading image shows.Second session
In the second session we install
PIL
from http://effbot.org/downloads/Imaging-1.1.7.tar.gz rather thanPillow
.Here the loading image doesn't show and the console shows the following error:
Error loading texture data/images/image-loading.gif
:Third session
In the third session we disable the exception catching from kivy/uix/image.py Image.texture_update() to see what really happens. By the way this exception catching looks too board to me and hides other things.
Then here is the session running again:
The fix is pretty simple and I'll come in a pull request later (hopefully this week).
The text was updated successfully, but these errors were encountered: