Thanks very much.
Line 157 in filter.php was changed from
$filename = $md5 . ".gif";
to
$filename = $md5 . ".png";
Line 107 in latex.php was changed from
$gif = "{$this->temp_dir}/$filename.gif";
to
$gif = "{$this->temp_dir}/$filename.png";
Line 149 in latex.php was changed from
unlink( "{$this->temp_dir}/$filename.gif" );
to
unlink( "{$this->temp_dir}/$filename.png" );
Line 43 in pic.php was changed from
$md5 = str_replace('.gif','',$image);
to
$md5 = str_replace('.png','',$image);
I think I got them all. There are references to the variable $gif. I left them as $gif although better form would have me replace them to $png. I got the filter working the way I liked with minimal edits to the original code and left the rest.
latex.php is here. filter.php is here. pic.php is here.
Hope this helps. I don't know why .png's render so much better on my system. I have a Gentoo server with all the latest packages installed. I think that ImageMagick's convert may be the culprit.
PNG is available? Why isn't it the default?!?
I switched over to jsMath because the GIFs that were output were so ugly. Maybe now I'll go back!
At least on my server the PNG images look identical to the GIF images.
I'll be sticking with jsMath.
Thanks again, Matthew.
I guess it's because every single graphical web browser out there supports GIF , but no all of them support PNG (IE 6.0 and below have problems with some PNG features; and yes, lots of people are still using IE 6.0 unfortunately).
Saludos, Iñaki.
You should actually modify also 4th file - see http://moodle.org/mod/forum/discuss.php?d=120418#p532389
IE6 is not the only reason - the original reason might be Mimetex that is compiled to render gifs - not pngs - so even if you make these changes and use Mimetex from folder filter/tex you get gifs and if you use local distribution of latex together with Ghostscript or ImageMagick you can get pngs...
There have been some tracker issues last year about changing the administration of this gif/png selection to settings of tex filter which would make much more sense than changing files of tex filter each time you upgrade moodle - and if we had some "universal tex renderer" (Google Chart API tex is using mimetex type code but renders pngs that are visible also in IE6) life would be so much easier - with or more likely without IE6.
Microsoft has set the kill date for IE6 as April 8, 2014, when it wraps up all support for Windows XP. So we have to suffer 4 more years...
Hi Mauno,
I have just found MDL-10197 that discusses exactly this topic, and have attached a patch there with a proposed solution (I see you are a watcher of the bug, so you'll probably receive an email about it )
Saludos, Iñaki.
1. GIF file too thin seems like figure 1.
2. In Moodle 2.0.3+, you can just set at: "SETTINGS, Site administration, Plugins, Filters, Tex Notations", "Convert output format" from GIF to PNG seems like figure 2.
3. PNG file is better seems like figure 3.