use dvipng instead of dvips + convert. Fixes #4351

This commit is contained in:
Yann Leboulanger 2008-09-27 16:46:18 +00:00
parent d63f328c9b
commit 43f2adeaf9
2 changed files with 7 additions and 18 deletions

View File

@ -968,18 +968,14 @@ class ConversationTextview:
cwd=gettempdir())
exitcode = p.wait()
if exitcode == 0:
p = Popen(['dvips', '-E', '-o', tmpfile + '.ps', tmpfile + '.dvi'],
cwd=gettempdir())
exitcode = p.wait()
if exitcode == 0:
latex_png_dpi = gajim.config.get('latex_png_dpi')
p = Popen(['convert', '-background', 'white', '-flatten', '-density', latex_png_dpi, tmpfile + '.ps', tmpfile + '.png'],
p = Popen(['dvipng', '-bg', 'white', '-T', 'tight', '-D',
latex_png_dpi, tmpfile + '.dvi', '-o', tmpfile + '.png'],
cwd=gettempdir())
exitcode = p.wait()
extensions = ['.tex', '.log', '.aux', '.dvi', '.ps']
extensions = ['.tex', '.log', '.aux', '.dvi']
for ext in extensions:
try:
os.remove(tmpfile + ext)

View File

@ -98,7 +98,7 @@ class FeaturesWindow:
_('Requires compilation of the idle module from Gajim sources.')),
_('LaTeX'): (self.latex_available,
_('Transform LaTeX expressions between $$ $$.'),
_('Requires texlive-latex-base, dvips and imagemagick. You have to set \'use_latex\' to True in the Advanced Configuration Editor.'),
_('Requires texlive-latex-base and dvipng. You have to set \'use_latex\' to True in the Advanced Configuration Editor.'),
_('Feature not available under Windows.')),
_('End to End Encryption'): (self.pycrypto_available,
_('Encrypting chatmessages.'),
@ -287,19 +287,12 @@ class FeaturesWindow:
exitcode = 1
if exitcode == 0:
try:
p = Popen(['dvips', '-E', '-o', tmpfile + '.ps', tmpfile + '.dvi'],
cwd=gettempdir())
p = Popen(['dvipng', '-bg', 'white', '-T', 'tight',
tmpfile + '.dvi', '-o', tmpfile + '.png'], cwd=gettempdir())
exitcode = p.wait()
except:
exitcode = 1
if exitcode == 0:
try:
p = Popen(['convert', tmpfile + '.ps', tmpfile + '.png'],
cwd=gettempdir())
exitcode = p.wait()
except:
exitcode = 1
extensions = [".tex", ".log", ".aux", ".dvi", ".ps", ".png"]
extensions = ['.tex', '.log', '.aux', '.dvi', '.png']
for ext in extensions:
try:
os.remove(tmpfile + ext)