mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: Fix image compression utilities opening a new console per invocation on windows
This commit is contained in:
parent
ec0520eb46
commit
0ebb0e096b
@ -86,7 +86,8 @@ def run_optimizer(file_path, cmd, as_filter=False, input_data=None):
|
|||||||
cwd = cwd.encode('mbcs')
|
cwd = cwd.encode('mbcs')
|
||||||
stdin = subprocess.PIPE if as_filter else None
|
stdin = subprocess.PIPE if as_filter else None
|
||||||
stderr = subprocess.PIPE if as_filter else subprocess.STDOUT
|
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
|
stderr = p.stderr if as_filter else p.stdout
|
||||||
if as_filter:
|
if as_filter:
|
||||||
src = input_data or open(file_path, 'rb')
|
src = input_data or open(file_path, 'rb')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user