Skip to content

ImageShow improvements#3450

Merged
hugovk merged 2 commits intopython-pillow:masterfrom
radarhere:imageshow
Dec 4, 2018
Merged

ImageShow improvements#3450
hugovk merged 2 commits intopython-pillow:masterfrom
radarhere:imageshow

Conversation

@radarhere
Copy link
Copy Markdown
Member

  • Added UnixViewer implementation of the get_command method
  • Supply filename through stdin instead of inline in Mac and Unix viewers. This is for the sake of security - rather than simply being quoted through shlex/pipes, the filename is now a variable. Feel free to tell me that this is more convoluted than necessary though, given that the filename being passed in does not originate externally.

@abarker
Copy link
Copy Markdown

abarker commented Jan 11, 2022

The evaluated shell variables $im need to be quoted or problems can arise with temp pathnames that have spaces in them.

#!/bin/bash

touch bar
mkdir "foo bar zoo"

TMP="foo bar zoo" python3 - <<'____HERE'
from PIL import Image
im = Image.open(r"/var/lib/app-info/icons/ubuntu-focal-updates-universe/48x48/inkscape_inkscape.png")
im.show()
____HERE

stat bar # The file is now deleted!

@radarhere
Copy link
Copy Markdown
Member Author

That problem should now be fixed, thanks to #6010, and released in Pillow 9.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants