Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bef5a8e

Browse files
authored
Merge pull request #8127 from QuLogic/fix-pgf-to-png
FIX: invalid arguments passed to pdftocairo in pgf
2 parents 03e540f + c0d5a14 commit bef5a8e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/matplotlib/backends/backend_pgf.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,9 @@ def make_pdf_to_png_converter():
191191
# pick converter
192192
if "pdftocairo" in tools_available:
193193
def cairo_convert(pdffile, pngfile, dpi):
194-
cmd = [str("pdftocairo"), "-singlefile", "-png",
195-
"-r %d" % dpi, pdffile, os.path.splitext(pngfile)[0]]
196-
# for some reason this doesn't work without shell
197-
check_output(cmd, shell=True, stderr=subprocess.STDOUT)
194+
cmd = [str("pdftocairo"), "-singlefile", "-png", "-r", "%d" % dpi,
195+
pdffile, os.path.splitext(pngfile)[0]]
196+
check_output(cmd, stderr=subprocess.STDOUT)
198197
return cairo_convert
199198
elif "gs" in tools_available:
200199
def gs_convert(pdffile, pngfile, dpi):

0 commit comments

Comments
 (0)