[Image-SIG] Correctly determine image size of a Photoshop EPS

Fredrik Lundh fredrik at pythonware.com
Wed Sep 21 13:09:11 CEST 2005


Stefano Masini wrote:

> So, I guess a quick fix would be to move the self.size = x,y code a
> little upper, but maybe there's a reason this should not be done, I
> don't know.

I don't see any problems with that; after all, the ImageData tag shouldn't be
used for EPS files that don't contain raster data, so the encoding shouldn't
really matter.

> By the way, I experimentally found out what the various values mean,
> by generating different eps files with Photoshop. Here's the list:
>
> 1 - binary
> 2 - ascii
> 3 - jpeg low quality
> 4 - jpeg medium quality
> 5 - jpeg high quality
> 6 - jpeg maximum quality
> 7 - ascii85
>
> These correspond to the options you get in the save dialog in Photoshop.
> Actually, I'm not sure what use you make with this information, since
> it's ghostscript's job to convert the file to ppmraw format, and I
> found no other reference in PIL's code to the above decoder type,
> except for self.tile2, which is not referenced anywhere as well.

the tile2 code is probably a left-over from an old experiment.  since PIL can
decode the various formats itself, it can skip the Ghostscript step and get the
image data directly from the file.  but it looks like that code has never been
enabled (probably due to a lack of samples).

>> if you can mail me a copy of the file (off-list), I can take a look when I find
>> the time.
>
> I will, thanks!

if you have the time to spare, (small) samples of all the above encoding types
would be nice to have.  (to avoid stupid mistakes, rectangular color images are
preferred.  it also helps if the colors are chosen so that a human viewer can
determine if they're right or wrong without having to think too much... ;-)

</F> 





More information about the Image-SIG mailing list