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 <christian.stenger@qt.io>
This commit is contained in:
Alessandro Portale
2021-09-29 00:10:53 +02:00
parent 2dfb9ff539
commit ceae67022c

View File

@@ -112,6 +112,8 @@ def printOutUnexported(svgIDs, scaleFactors):
def exportPngs(svgIDs, svgFile, scaleFactors, inkscape): def exportPngs(svgIDs, svgFile, scaleFactors, inkscape):
inkscapeProcess = subprocess.Popen([inkscape, '--shell'], inkscapeProcess = subprocess.Popen([inkscape, '--shell'],
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=qtcRoot()) cwd=qtcRoot())
actions = ["file-open:" + svgFile] actions = ["file-open:" + svgFile]
for id in svgIDs: for id in svgIDs: