-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
What did you do?
- Download this PNG image from Wikipedia. https://en.wikipedia.org/wiki/PNG#/media/File:PNG_transparency_demonstration_1.png Save it as
test.png. - Run the test script shown below.
from PIL import Image, ImageShow
img=Image.open("test.png")
print(ImageShow.show(img))What did you expect to happen?
I expected a new window to be created in which the downloaded image was displayed.
What actually happened?
The command printed "True" on the command line and exited without displaying the image.
I think the cause of the issue is that in my environment, the first viewer tried by pillow was the XDGViewer. Unfortunately, xdg-open was not correctly configured. When I ran xdg-open test.png directly, the command exited with code 4 without displaying anything.
At the moment, XDGViewer.show_file does not check the return code of xdg-open, and always returns 1 after launching the xdg-open subprocess. This caused ImageShow.show to not bother trying the DisplayViewer option.
As far as I can tell, none of the viewers check the return code of the viewer subprocess. Is this a deliberate design decision?
What are your OS, Python and Pillow versions?
- OS: SLES15
- Python: 3.10.11
- Pillow: 11.3.0