From ceae67022cb035805a77731e3404ce3128dfc7e7 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 29 Sep 2021 00:10:53 +0200 Subject: [PATCH] Icons: Fix icon export script The export script is designed to first let Inkscape export all .pngs, and then to optimize the .pngs via optipng. This used to work with previous Inkscape and Python versions. A few Inkscape and Python versions later, however, the optimizing phase starts already while the exporting is still happening. That can leave .pngs unoptimized. This change defines the stdout and stderr channels as subprocess.PIPE in the subprocess.Popen call. That restores the intended behavior with current Inkscape and Python versions. Change-Id: I3b2775cc24b33ffb181c3b24e545f8cf98244103 Reviewed-by: Christian Stenger --- src/tools/icons/export.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/icons/export.py b/src/tools/icons/export.py index bf8f0baa393..2ead1ceab4c 100644 --- a/src/tools/icons/export.py +++ b/src/tools/icons/export.py @@ -112,6 +112,8 @@ def printOutUnexported(svgIDs, scaleFactors): def exportPngs(svgIDs, svgFile, scaleFactors, inkscape): inkscapeProcess = subprocess.Popen([inkscape, '--shell'], stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, cwd=qtcRoot()) actions = ["file-open:" + svgFile] for id in svgIDs: