Forum archive 2000-2006

John Jones - New version of dvipng

John Jones - New version of dvipng

by Arnold Pizer -
Number of replies: 0
inactiveTopicNew version of dvipng topic started 6/12/2003; 3:10:42 PM
last post 6/16/2003; 4:39:36 PM
userJohn Jones - New version of dvipng  blueArrow
6/12/2003; 3:10:42 PM (reads: 1284, responses: 3)
Two bugs with dvipng had previously been reported here
  • cropping of right and bottom pixels of images
  • crashing on blank images, like \( \ \)
Version 0.3 of dvipng was just released and it seems to fix both of those bugs. Plus, it uses a configure script to set up its compilation. It can be downloaded from

 

  http://prdownloads.sourceforge.net/preview-latex/

When I ran configure, I had to set two shell environment variables, LDFLAGS and CPPFLAGS so that configure would find my copy of the gd library, and the library/include file for kpathsea.

This version of dvipng seems to return a different exit code on completion. As a result, the current version of WeBWorK would then give pink screens whenever images are made successfully. To compensate, you can either get a new copy of system/lib/ImageGenerator.pm from WeBWorK cvs, or make the following change to the file. Near the very end is the line which looks like the following:

warn "$Global::externalDvipngPath -x$dvipng_res -bgTransparent -Q$Global::dvipngShrinkFactor -mode $Global::dvipngMode -D$Global::dvipngDPI $self->{filenamestart}.dvi \>\>$error_log 2\>\>$error_log -- FAILED in ImageGenerator.pm returned $cmdout" if $cmdout != 256;

Then end of the line should be changed to just

... in ImageGenerator.pm returned $cmdout" if $cmdout;

In other words, the "!= 256" gets deleted.

John

<| Post or View Comments |>


userArnold K. Pizer - Re: New version of dvipng  blueArrow
6/13/2003; 11:52:43 AM (reads: 1515, responses: 0)
Hi John,

Can we change this so that it works with both versions? For example will the following code work? I.e. is 256 ever returned as an exit code on an error in version 0.3?

... in ImageGenerator.pm returned $cmdout" if ($cmdout and $cmdout != 256);

Arnie

<| Post or View Comments |>


userJohn Jones - Re: New version of dvipng  blueArrow
6/13/2003; 1:34:54 PM (reads: 1503, responses: 0)
Hi Arnie,

That's a good idea. As far as I can see, it should exit with either 0 or 1.

Fixed.

John

<| Post or View Comments |>


userArnold K. Pizer - Re: New version of dvipng  blueArrow
6/16/2003; 4:39:36 PM (reads: 1567, responses: 0)
Thanks John for adding this change to the CVS.

Here are some specific instructions for getting dvipng to compile under FreeBSD.

1. Edit dvipng.h adding the code

#ifndef INT32_MIN
#define INT32_MIN ((int32_t)(-2147483647-1))
#endif
#ifndef INT32_MAX
#define INT32_MAX ((int32_t)(2147483647))
#endif

just before where INT32_MAX, etc. is used.

2. Run the commands

 

configure LDFLAGS='-L/usr/local/lib' CPPFLAGS='I/usr/local/include/gd -I/usr/local/include'
gmake
gmake install

gmake install has to be run as root.

Arnie

<| Post or View Comments |>