Skip to content

Commit

Permalink
Fix hanging export on Windows. Fix picture export ("-C" option), issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-t committed Apr 22, 2018
1 parent ff802c1 commit e500307
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions export_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit e500307

Please sign in to comment.