Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 750107 - dev-python/pyglet fails to save images with dev-python/pillow-8.0.0
Summary: dev-python/pyglet fails to save images with dev-python/pillow-8.0.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-19 09:11 UTC by Risto A. Paju
Modified: 2021-01-06 07:36 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Risto A. Paju 2020-10-19 09:11:41 UTC
I use the following line from Pyglet docs to save screenshots in my OpenGL applications:

pyglet.image.get_buffer_manager().get_color_buffer().save(shotfile)

I have compiled Pyglet with USE=image to allow multiple image formats, so it uses dev-python/pillow. After updating Pillow from 7.2.0 to 8.0.0, this fails with the following error:

  File "/usr/lib/python3.7/site-packages/pyglet/image/__init__.py", line 499, in save
    encoder.encode(self, file, filename)
  File "/usr/lib/python3.7/site-packages/pyglet/image/codecs/pil.py", line 135, in encode
    image_from_fn = getattr(Image, "frombytes", getattr(Image, "fromstring"))
  File "/usr/lib/python3.7/site-packages/PIL/Image.py", line 62, in __getattr__
    raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
AttributeError: module 'PIL.Image' has no attribute 'fromstring'

I have tested both latest dev-python/pyglet-1.5.8 and the previous 1.5.7-r1.

Presumably, Pyglet needs to be updated to work with Pillow 8. In the meantime, Pyglet dependencies should disallow Pillow versions 8 or higher.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-21 19:32:02 UTC
Could you try with the newest pyglet version?
Comment 2 Risto A. Paju 2020-12-21 23:10:43 UTC
(In reply to Michał Górny from comment #1)
> Could you try with the newest pyglet version?

Tested Pyglet 1.5.13 with Pillow 8.0.1 and it works fine :)
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-21 23:44:31 UTC
Thank you!