Skip to content
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

ImageShow improvements #3450

Merged
merged 2 commits into from Dec 4, 2018
Merged

ImageShow improvements #3450

merged 2 commits into from Dec 4, 2018

Conversation

radarhere
Copy link
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

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
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.

None yet

3 participants