Haven't checked the DSC spec in ages, but given your observation, it'd probably make sense to skip all non-DSC comments no matter what the spec actually says. Can you provide a patch (or a sample file)?
</F> On Sat, Mar 20, 2010 at 11:13 PM, Bill Janssen <jans...@parc.com> wrote: > I think I need a language lawyer. I'm finding that PIL 1.1.7 can't > import EPS files output by Adobe Illustrator. It chokes on the > following sequence of lines in the header: > > %!PS-Adobe-3.0 EPSF-3.0 > %%Creator: Adobe Illustrator(R) 8.0 > %%AI8_CreatorVersion: 13.0.0 > %%For: (Administrator) () > %%CreationDate: 8/20/2008 6:47 PM > %%BoundingBox: 0 0 2801 2801 > %%HiResBoundingBox: 0 0 2800.5 2800.5 > %%DocumentProcessColors: Cyan Magenta Yellow Black > %%DocumentSuppliedResources: procset Adobe_level2_AI5 1.2 0 > %%+ procset AGM_Gradient 1.0 0 > %%+ procset Adobe_ColorImage_AI6 1.3 0 > %%+ procset Adobe_Illustrator_AI5 1.3 0 > %%+ procset Adobe_pattern_AI5 1.0 0 > %%+ procset Adobe_cshow 2.0 8 > %%+ procset Adobe_shading_AI8 1.0 0 > %AI5_FileFormat 4.0 > %AI3_ColorUsage: Color > %AI3_IncludePlacedImages > [...] > > When I look at it with pdb, the problem seems to be the %AI5 and %AI3 > lines -- they don't match the header line template, though I believe > they are valid Postscript comments: > > (Pdb) !Image.open("/project/uplib/samples/postscript/badfoo.eps") > !Image.open("/project/uplib/samples/postscript/badfoo.eps") > *** IOError: bad EPS header > (Pdb) l > 201 if k[:8] == "PS-Adobe": > 202 self.info[k[:8]] = k[9:] > 203 else: > 204 self.info[k] = "" > 205 else: > 206 -> raise IOError, "bad EPS header" > 207 > 208 s = fp.readline() > 209 > 210 if s[:1] != "%": > 211 break > (Pdb) p s > '%AI3_ColorUsage: Color' > (Pdb) field > <_sre.SRE_Pattern object at 0x4798a0> > (Pdb) field.match(s) > (Pdb) ^D > > So, are Postscript comments allowed in the DSC headers? That is, is > this a PIL bug or an Illustrator bug. > > Bill > _______________________________________________ > Image-SIG maillist - image-...@python.org > http://mail.python.org/mailman/listinfo/image-sig > _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig