Hide the Ghostscript progress dialog on Windows

This commit is contained in:
Hugo 2018-09-26 14:38:33 +03:00
parent 7b425a96c1
commit f13c150f00

View File

@ -139,7 +139,12 @@ def Ghostscript(tile, size, fp, scale=1):
# push data through ghostscript
try:
with open(os.devnull, 'w+b') as devnull:
subprocess.check_call(command, stdin=devnull, stdout=devnull)
startupinfo = None
if sys.platform.startswith('win'):
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
subprocess.check_call(command, stdin=devnull, stdout=devnull,
startupinfo=startupinfo)
im = Image.open(outfile)
im.load()
finally: