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

This commit is contained in:
Yann Leboulanger 2008-04-01 23:33:23 +00:00
parent f3665cd689
commit e40cb0d4b3

View file

@ -854,8 +854,16 @@ class ConversationTextview:
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']