[l2h] pstoimg on cygwin?

Alle Meije Wink alle_meije at yahoo.co.uk
Mon Mar 26 12:43:30 CEST 2007


Dear Igor,

[oops.. sent too soon]

Do you know if there is a gnuplot (or gs) option that controls whether 
EPS or EPSF is in the header?

For now (the pstoimg line is used in a script that generates >1 eps + 
png files) I shall use
	perl -i -wpe 's/EPSF-2.0/EPS-2.0/' *.eps
to fix it.

I think it is the SHOWPAGE command rather than anything else though. 
Because my black and white .eps files turn into .png files that nicely 
have the size of the plots. The .png file that I get from the coloured 
.eps file has an A4 bounding box.

Do you get that as well?

many thanks
Alle Meije Wink

Igor Peshansky wrote:
> Hi,
> 
> I've investigated this a bit.  If you run pstoimg with -debug, you'll see
> something like
> 
> pstoimg: Running /usr/local/bin/gs  -sDEVICE=pnmraw -g792x277    -sOutputFile=/tmp/p5960.pnm
> GS>-50 -50 translate
> GS>(IAN_PER3rawrotation.eps) run
> GS>showpage
> GS>quit
> 
> It's the "showpage" that is the problem, since the eps you have already
> has a "showpage".  So the second page ends up being blank (and
> black-and-white, with depth 1).  Running the gs command manually without
> the second "showpage" produces a beautiful png after ppmquant.
> 
> The reason it works on black-and-white images is that ppmquant does not
> complain if both pages have color depth 1.  The reason it worked for you
> on Linux is probably the fact that the Linux version of gs produces the
> second page at the same color depth as the first one, rather than
> black-and-white (possibly an optimization in Cygwin's gs).
> 
> The generation of "showpage" is guarded by the $epsf flag in pstoimg.
> Editing your .eps and changing the "EPSF-2.0" to "EPS-2.0" in the first
> line made pstoimg work with no problems.  It's unclear why the "showpage"
> is needed for EPSF files, though, so it would probably not be a good idea
> to remove it.  As-is, just consider the EPSF support in Cygwin's gs
> broken.
> HTH,
> 	Igor




More information about the latex2html mailing list