[Image-SIG] Handling of signed 16-bit TIFF images seems not to work...

David Izraelevitz david.izraelevitz at alum.mit.edu
Wed Jul 14 00:16:00 CEST 2004

First, the context:

 >>> sys.platform
 >>> sys.version
'2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)]'

and running PIL 1.1.4

I have a TIFF image with mode 'I;16S' that loads  i.e.:
 >>>import Image
 >>>im = Image.open("image.tif")

but then
 >>>im_data = im.getdata()
Traceback (most recent call last):
   File "<pyshell#14>", line 1, in ?
     im2_data = im2.getdata()
   File "C:\Python23\Lib\site-packages\PIL\Image.py", line 741, in getdata
   File "C:\Python23\Lib\site-packages\PIL\ImageFile.py", line 151, in load
   File "C:\Python23\Lib\site-packages\PIL\ImageFile.py", line 206, in 
     self.im = Image.core.new(self.mode, self.size)
ValueError: unrecognized mode

When I inquire about the image mode:

 >>> im.mode

I have looked a the C-code in my Unix installation and it is unclear 
whether this mode is handled correctly. Any pointers?


More information about the Image-SIG mailing list