diff --git a/export_layers.py b/export_layers.py index d6f5d12..5b8eef6 100644 --- a/export_layers.py +++ b/export_layers.py @@ -92,10 +92,17 @@ def get_layers(self, src): return layers def exportToPng(self, svg_path, output_path): - area_param = '-D' if self.options.crop else 'C' - command = "inkscape %s -d %s -e \"%s\" \"%s\"" % (area_param, self.options.dpi, output_path, svg_path) - - p = subprocess.Popen(command.encode("utf-8"), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + command = [ + "inkscape", + "-D" if self.options.crop else "-C", + "-d", str(self.options.dpi), + "-e", output_path.encode("utf-8"), + svg_path.encode("utf-8") + ] + p = subprocess.Popen( + command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) p.wait() def convertPngToJpg(self, png_path, output_path):