Skip to content

Commit fc30eba

Browse files
authored
Merge pull request #7791 from radarhere/imageshow
2 parents 93bf991 + 373c62e commit fc30eba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/PIL/ImageShow.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ def get_command(self, file: str, **options: Any) -> str:
138138
f'&& del /f "{file}"'
139139
)
140140

141+
def show_file(self, path: str, **options: Any) -> int:
142+
"""
143+
Display given file.
144+
"""
145+
subprocess.Popen(
146+
self.get_command(path, **options),
147+
shell=True,
148+
creationflags=getattr(subprocess, "CREATE_NO_WINDOW"),
149+
) # nosec
150+
return 1
151+
141152

142153
if sys.platform == "win32":
143154
register(WindowsViewer)

0 commit comments

Comments
 (0)