|
From: <var...@us...> - 2021-06-22 16:26:36
|
Revision: 10315
http://sourceforge.net/p/phpwiki/code/10315
Author: vargenau
Date: 2021-06-22 16:26:35 +0000 (Tue, 22 Jun 2021)
Log Message:
-----------
Make lib/plugin/TexToPng.php work
Modified Paths:
--------------
trunk/lib/plugin/TexToPng.php
Modified: trunk/lib/plugin/TexToPng.php
===================================================================
--- trunk/lib/plugin/TexToPng.php 2021-06-22 15:27:04 UTC (rev 10314)
+++ trunk/lib/plugin/TexToPng.php 2021-06-22 16:26:35 UTC (rev 10315)
@@ -39,9 +39,6 @@
*----------------------------------------------------------------------*/
// needs (la)tex, dvips, gs, netpbm, libpng
// LaTeX2HTML ftp://ftp.dante.de/tex-archive/support/latex2html
-$texbin = '/usr/bin/tex';
-$dvipsbin = '/usr/bin/dvips';
-$pstoimgbin = '/usr/bin/pstoimg';
// output mere debug messages (should be set to false in a stable
// version)
@@ -266,11 +263,14 @@
function TexToImg($texstr, $scale, $aalias, $transp)
{
- //$cacheparams = $GLOBALS['CacheParams'];
+ $texbin = '/usr/bin/tex';
+ $dvipsbin = '/usr/bin/dvips';
+ $pstoimgbin = '/usr/bin/pstoimg';
+ $cache_dir = '/tmp/cache';
$tempfiles = $this->tempnam('TexToPng');
$img = 0; // $size = 0;
- // procuce options for pstoimg
+ // produce options for pstoimg
$options =
($aalias ? '-aaliastext -color 8 ' : '-color 1 ') .
($transp ? '-transparent ' : '') .
@@ -280,7 +280,7 @@
// rely on intelligent bool interpretation
$ok = $tempfiles &&
$this->createTexFile($tempfiles . '.tex', $texstr) &&
- $this->execute('cd ' . $cacheparams['cache_dir'] . '; ' .
+ $this->execute('cd ' . $cache_dir . '; ' .
"$texbin " . $tempfiles . '.tex', true) &&
$this->execute("$dvipsbin -o" . $tempfiles . '.ps ' . $tempfiles . '.dvi') &&
$this->execute("$pstoimgbin $options"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|