[l2h] pstoimg bug?

Dan Scholnik Dan Scholnik <scholnik@radar.nrl.navy.mil>
Mon, 12 Jul 1999 20:46:46 -0400


I think I found a bug in pstoimg in the 99.2alpha[89] dist.  I noticed
that the inline math bitmaps had too much extra space at the bottom, so I
ran latex2html with -debug.  A typical image creation log:

# begin snippet #
Converting image #67
Debug (syswait): Running "/usr/bin/perl /usr/local/latex2html99.2a/bin/pstoimg -type png -debug -tmp /tmp/l2h16149 -discard -interlace -antialias -depth 1 -scale 1.4 -geometry 56x17 -crop bls -margins 50,72 -transparent -out img67.png /tmp/l2h16149/image067.ps"
 at /usr/local/bin/latex2html line 4139
pstoimg V99.2alpha8 (Revision 1.7, Perl 5.00503)
pstoimg: Temporary directory is /tmp/l2h16149
pstoimg: Processing /tmp/l2h16149/image067.ps
pstoimg: EPSF dimensions are 61x24
pstoimg: Running /usr/bin/gs  -sDEVICE=ppmraw -g86x34  -r101 -dTextAlphaBits=4  -sOutputFile=/tmp/l2h16149/p16167.pnm 
GS>-49 -697 translate
GS>(/tmp/l2h16149/image067.ps) run
GS>showpage
GS>quit

Aladdin Ghostscript 5.50 (1998-9-16)
Copyright (C) 1998 Aladdin Enterprises, Menlo Park, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>GS>>>showpage, press <return> to continue<<
GS>>>showpage, press <return> to continue<<
GS>Running "/usr/bin/pnmcrop < /tmp/l2h16149/p16167.pnm | /usr/bin/pnmcrop -bot | /usr/bin/pnmcrop -l  > /tmp/l2h16149/p16167.t01"
pnmcrop: cropping 2 rows off the top
pnmcrop: cropping 1 row off the bottom
pnmcrop: cropping 1 col off the left
pnmcrop: cropping 3 cols off the right
pnmcrop: cropping 2 rows off the bottom
pnmcrop: cropping 2 cols off the left
Image "/tmp/l2h16149/p16167.pnm" is PPM, 80x29
Running "/usr/bin/pnmcrop -bot < /tmp/l2h16149/p16167.pnm > /tmp/l2h16149/p16167.t02"
pnmcrop: cropping 10 rows off the bottom
Image "/tmp/l2h16149/p16167.t02" is PPM, 80x19
Image "/tmp/l2h16149/p16167.pnm" is PPM, 80x29
Running "/usr/bin/ppmquant -floyd 256 < /tmp/l2h16149/p16167.pnm | /usr/bin/pnmtopng -interlace -trans '#ffffff'  > img67.png"
ppmquant: making histogram...
ppmquant: 16 colors found
ppmquant: choosing 256 colors...
ppmquant: mapping image to new colors...
pstoimg: Written img67.png
Debug (syswait): Finished child process: #16167
 at /usr/local/bin/latex2html line 4139
# end snippet #

in the process of turning the .ps image to a .png, pstoimg created 3
temporary files: stuff.t00, stuff.t01, and stuff.t02, with increasing
amounts of cropping.  The stuff.t02 is what I <think> I want, it is
fully cropped.  But stuff.t01 is what winds up written as img67.png,
and winds up in my document.  I'm guessing this is a simple counter
error or something, and I've been looking through the file, trying to
learn Perl.... :)

This happens to pretty much all run-of-the mill math, so I'm not
including any examples unless I'm the only one with this problem.

thanks,
Dan Scholnik
scholnik@ieee.org