[Image-SIG] Sun Rasterfile support broken in 1.0b1

Charles G Waldman cgw@pgt.com
Tue, 9 Feb 1999 13:31:04 -0500 (EST)


I just came across this, when running a script to batch-convert some
older Sun .RAS files to a different format:


janus:~> file eq.ras
eq.ras: Sun raster image data, 640 x 480, 8-bit, RGB colormap

janus:~> python
Python 1.5.2b2 (#2, Jan 12 1999, 16:00:44)  [GCC egcs-2.90.29 980515 (egc on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import Image
>>> Image.VERSION
'1.0b1'
>>> x=Image.open("eq.ras")
>>> x.save("eq.png")
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python1.5/site-packages/PIL/Image.py", line 654, in save
    self.load()
  File "/usr/local/lib/python1.5/site-packages/PIL/ImageFile.py", line 134, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
  File "/usr/local/lib/python1.5/site-packages/PIL/Image.py", line 225, in _getdecoder
    return apply(decoder, (mode,) + args + extra)
ValueError: unknown raw mode



I'm looking into the problem; I don't have a fix yet however.  In the
meanwhile I just wanted to bring it to your attention.