Hi Andre,

On Mon, 22 May 2006, Andre Wobst wrote:

[..]

> > So therefore I would conclude that there is no alternative to
> > ASCIIHexDecode...
>
> Ok, yes. You're right. The point is taken.
>
> So the situation is now even worse than before. We know very well how
> to produce a PostScript file which is broken on almost all existing
> ghostscript installations ... and now??? We can create it to crash
> when sending it unmodified to ghostscript,

Somehow this sounds worse than the following.

> or when its send by
> ghostview to the ghostscript interpreter

Well, this *might* be better because it is "only" gv which is
affected?

> ... as you wish ...

tertium non datur ;-)

 > > > The point is that we currently do not support the PSbinascii flag very
> > > well ... it's a hack (beside that it's not documented etc.) and we
> > > should get rid of it again ASAP (as we do now understand what was
> > > going wrong and since a proper solution).
> >
> > OTOH, this seems the only solution to the original problem
> > as long as one cannot be sure that all readers will have
> > ghostscript>=8.54, so I am not so positive on removing it.
>
> Right. Somehow this is bad ... and as we now know how to build such a
> file, we can even create one, which breaks ghostscript by sending it
> unchanged to the ghostscript interpreter. Damn ...
>
> I really don't know what we should do in such a situation. Using hex
> encoding instead of ASCII85 is that bad (in terms of almost doubling
> the file size for large bitmap junks; beside that we need to properly
> implement it) ...

Personally I am a strong advocator of small files (one of the many
reasons for PyX;-), but
here I would pay the price of a factor 1.6 so that
the resulting plots can be displayed.

Well, could one write a routine which checks if the embedded bitmap
contains a problematic sequence of characters?
Then one could  for example either
(a) automatically switch to hex encoding
(b) or at least warn the user?
    (In such a case I would even consider modifying one bit
    of my graphics...)

Anyway, I don't see any real alternative to hex encoding
as an option for PyX...

Best, Arnd

P.S.:

Funnily, I did mass-produce figures (>1000) with other
programms (e.g pgplot and others) to generate .eps files with
bitmaps and never had such problems. But maybe it was a different
gv/gs version (it was a couple of years ago by now) and
the problem was not there?
Hmm, let's have a look at some older pgplot generated file:
There it for example uses:

/readstring {
  currentfile exch readhexstring pop
} bind def
/picstr 221 string def
221 111 8 [
 3.112E-02  0.000E+00  0.000E+00  3.126E-02 -2.702E-03 -1.089E+02 ]
{currentfile picstr readhexstring pop} image
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
[...]

Other files (generated by pnmtops) contain a slightly more complicated
readstring and a routine readrlestring to cater for RLE
(and the example I am looking at uses colorimage)

OTOH, gimp generated .eps files use

[...]
% Strings to hold RGB-samples per scanline
/rstr 420 string def
/gstr 420 string def
/bstr 420 string def
{currentfile /ASCII85Decode filter /RunLengthDecode filter rstr readstring
pop}
{currentfile /ASCII85Decode filter /RunLengthDecode filter gstr readstring
pop}
{currentfile /ASCII85Decode filter /RunLengthDecode filter bstr readstring
pop}
true 3
%%BeginData:        43511 ASCII Bytes
colorimage
[...]

So it should be possible to generate problematic files with gimp as
well, or?

Not sure how much file size reduction is offered by RLE, but
usually gimp produces the smallest file sizes for .eps.




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to