[Image-SIG] suspected bug in PIL 1.1.3 bmp reader

Jeff Breidenbach jbreiden@parc.com
Tue, 8 Apr 2003 20:41:42 PDT

Hi all,

I have an uncompressed BMP file, that I believe to be valid, that PIL
chokes on. I can call Image.open no problem, but PIL fails for any
sort of operation beyond that. My Python/PIL installation works 
fine with other image files and my best guess is this is a
bug. Any thoughts?


--- image file ---


----- python trasnscript ---

Python 2.2.2 (#1, Mar 21 2003, 23:01:54)
[GCC 3.2.3 20030316 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Image
>>> a =  Image.open("foo.bmp")
>>> a.save("bar.bmp")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/site-packages/PIL/Image.py", line 730, in
  File "/usr/lib/python2.2/site-packages/PIL/ImageFile.py", line 140, in
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
  File "/usr/lib/python2.2/site-packages/PIL/Image.py", line 253, in
_getdecoder    return apply(decoder, (mode,) + args + extra)
ValueError: unknown raw mode

--- platform ---

Debian Linux :: PIL :: Version: 1.1.3-4
Debian Linux :: Python :: Version: 2.2.2-6

--- commentary on image file from ImageMagick ---

identify -verbose foo.bmp
Image: foo.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Geometry: 875x875
  Class: PseudoClass
  Type: bilevel
  Depth: 8 bits-per-pixel component
  Colors: 2
    0: (255,255,255)      grey100
    1: (  0,  0,  0)      black
  Resolution: 118.11x118.11 pixels/centimeter
  Filesize: 95.8k
  Interlace: None
  Background Color: grey100
  Border Color: #DFDFDF
  Matte Color: grey74
  Dispose: Undefined
  Iterations: 0
  Tainted: False
  User Time: 0.020u
  Elapsed Time: 0:01

Jeff Breidenbach <jbreiden@parc.com>
Palo Alto Research Center (PARC)