[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
'win32'
 >>> 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()
fails:
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
     self.load()
   File "C:\Python23\Lib\site-packages\PIL\ImageFile.py", line 151, in load
     self.load_prepare()
   File "C:\Python23\Lib\site-packages\PIL\ImageFile.py", line 206, in 
load_prepare
     self.im = Image.core.new(self.mode, self.size)
ValueError: unrecognized mode


When I inquire about the image mode:

 >>> im.mode
'I;16S'

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

Thanks.





More information about the Image-SIG mailing list