[l2h] Re: pstoimg bug?

Marek Rouchal Marek Rouchal <marek@btfmd1.fs.uni-bayreuth.de>
Tue, 13 Jul 1999 18:10:25 +0200 (CEST)


On Mon, 12 Jul 1999, Dan Scholnik wrote:

> 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:

This is not a bug, it's a feature: The option "-crop bls" causes pstoimg
crop off any whitespace, then the black "rulers" at the left and the
bottom and then "shave" the image at the bottom, i.e. cut off white but
only if there are 1 or 2 lines of white only. In your case there are 10
lines of white. These were added for alignment reasons. There is no bug in
pstoimg.
However perhaps there is a bug in image generation in general. Ross, do
you think there might be a problem here?
Dan, does the image look mis-aligned? I.e., is the image's baseline on the
baseline of the text or somewhere above or below?

Cheers,

Marek


> # 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
> 


****************************************************************************
* Marek Rouchal                                    <Marek.Rouchal@gmx.net> *
* -------------------------\     http://saftsack.fs.uni-bayreuth.de/~marek *
* Therese-Giehse-Allee 23   \----------------------------------------------*
* D-81739 Muenchen                finger marek@saftsack.fs.uni-bayreuth.de *
* Tel/FAX +49-89-63496882         for PGP Public Key                       *
****************************************************************************