[Image-SIG] PIL & FH10 eps files

Bernhard Herzog bh@intevation.de
18 Jul 2002 20:18:25 +0200


abel deuring <a.deuring@satzbau-gmbh.de> writes:

> hi all,
> 
> it seems that PIL.EpsImagePlugin (version 1.1.3) does not like the
> headers from EPS files produced by Freehand 10: (1) FH10 writes an empty
> line after the leading "%!PS-Adobe-2.0 EPSF-1.2", and (2) the line
> "%ALDOriginalFile:..." raises the exception IOError, "bad EPS header".
> Neither the regex "split" nor the regex "field" recognize this line.
> Attached is a fix and an example for FH10 EPS header.
> 
> Abel%!PS-Adobe-2.0 EPSF-1.2
> 
> %%Title: Unbenannt-1

That empty line is part of the output? In that case the EPS file is not
really an EPS file because the header doesn't contain the required (for
EPS) BoundingBox DSC comment (quoting from the DSC specification):

    Because header comments are contiguous, any line that does not begin
    with %X where X is any printable character except space, tab, or
    newline implicitly denotes the end of the header section.

    %!PS-Adobe-3.0
    %%Title: (Example of Header Comment Termination)
    ...More header comments...
    %%DocumentResources: font Sonata
    %GBDNodeName: smith@atlas.com
    % This line implicitly denotes the end of the header section.


  Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                           http://www.mapit.de/