Skip to content
Snippets Groups Projects
Commit e40cb0d4 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

use -alpha option only with recent version of imagemagick. fixes #3755

parent f3665cd6
No related branches found
No related tags found
No related merge requests found
......@@ -854,8 +854,16 @@ def latex_to_image(self, str):
exitcode = p.wait()
if exitcode == 0:
p = Popen(['convert', '-alpha', 'off', tmpfile + '.ps',
tmpfile + '.png'], cwd=gettempdir())
convert_version = helpers.get_output_of_command(
'convert -version')[0].split()[2]
convert_version = [int(n) for n in convert_version.split('.')]
if convert_version > [6, 3, 4]:
# -alpha option was added in 6.3.5 release
alpha = ['-alpha', 'off']
else:
alpha = []
p = Popen(['convert'] + alpha + [tmpfile + '.ps', tmpfile + '.png'],
cwd=gettempdir())
exitcode = p.wait()
extensions = ['.tex', '.log', '.aux', '.dvi', '.ps']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment