Description of problem: The python-pyglet spec file contains this: # Remove the bundled pypng library (python-pillow provides the same functionality) rm pyglet/image/codecs/png.py rm pyglet/extlibs/png.py This has led directly to bug 1906363. Would you please include a porting guide, perhaps in a README of some kind, that says, "If your application wants to use PNGImageDecoder, then patch it like this"? I am unfamiliar with both pyglet and pillow, so don't know how to fix bug 1906363. Please give me a guide. Version-Release number of selected component (if applicable): python3-pyglet-1.5.11-1.fc34 How reproducible: N/A Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
pyglet itself has: # Fallback: PIL try: from pyglet.image.codecs import pil add_encoders(pil) add_decoders(pil) except ImportError: pass # Fallback: PNG loader (slow) try: from pyglet.image.codecs import png add_encoders(png) add_decoders(png) except ImportError: pass sympy has: if fmt == "png": from pyglet.image.codecs.png import PNGImageDecoder img = image.load(fname, decoder=PNGImageDecoder()) else: raise ValueError("pyglet preview works only for 'png' files.") I guess this works: from pyglet.image.codecs.pil import PILImageDecoder img = image.load(fname, decoder=PILImageDecoder()) And should support more file types, even. However, this is all only assumptions, I don't know pyglet/sympy internals, just passing by.
> However, this is all only assumptions, I don't know pyglet/sympy internals, just passing by. Verified that it works: https://bugzilla.redhat.com/show_bug.cgi?id=1906363#c1
It is enough to let Pyglet choose an appropriate decoder with: img = image.load(fname) I see no reason to force a specific decoder, and the Pyglet docs even discourage it "unless your application has to work around specific deficiences in an operating system decoder"[0]. [0] https://pyglet.readthedocs.io/en/latest/programming_guide/image.html?highlight=PILImageDecoder#loading-an-image
I checked that this works for sympy; see https://src.fedoraproject.org/rpms/sympy/pull-request/3
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle. Changing version to 34.
I've (finally) added a note with a link to the Pyglet docs to the spec file. I don't know of a better place to put it: a README for the RPM would not be much more discoverable, and I'd need to write one to put a note in it :) Thanks for getting in touch!