From 0ebb0e096b6e8899e092365bbdd805ff5761a752 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 13 Dec 2015 16:18:26 +0530 Subject: [PATCH] Edit book: Fix image compression utilities opening a new console per invocation on windows --- src/calibre/utils/img.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/utils/img.py b/src/calibre/utils/img.py index e94c192312..0ec208cc36 100644 --- a/src/calibre/utils/img.py +++ b/src/calibre/utils/img.py @@ -86,7 +86,8 @@ def run_optimizer(file_path, cmd, as_filter=False, input_data=None): cwd = cwd.encode('mbcs') stdin = subprocess.PIPE if as_filter else None stderr = subprocess.PIPE if as_filter else subprocess.STDOUT - p = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=stderr, stdin=stdin) + creationflags = 0x08 if iswindows else 0 + p = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=stderr, stdin=stdin, creationflags=creationflags) stderr = p.stderr if as_filter else p.stdout if as_filter: src = input_data or open(file_path, 'rb')