[Image-SIG] ValueError: unrecognized mode

Nickolas Raterman raterman at geology.ucdavis.edu
Wed Aug 24 22:06:25 CEST 2005


     I am trying to follow the instructions for "Writing you own file  
decoder" in the PIL Handbook.  The file I wish to import is in 16 bit  
little endian unsigned int and has a 128 byte header at the beginning  
of the file (just like in the example).

After writting the decoder and placing it in the proper directory I  
can open the file with the Image.open method but then the load method  
fails with the ValueError: unrecognized mode

However, I am using the mode indicated for my file format

Below is a copy of my interactive session where I tried to load the  

Python 2.4.1 (#1, Aug 24 2005, 11:19:07)
[GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import Image
 >>> im = Image.open("recobj_250.sdtt")
 >>> im.mode
 >>> im.load()
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/local/lib/python2.4/site-packages/PIL/ImageFile.py",  
line 155, in load
   File "/usr/local/lib/python2.4/site-packages/PIL/ImageFile.py",  
line 221, in load_prepare
     self.im = Image.core.new(self.mode, self.size)
ValueError: unrecognized mode

I have also attached a copy of my plug-in file.  Thanks in advance  
for any help
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SdttImagePlugin.py
Type: text/x-python-script
Size: 757 bytes
Desc: not available
Url : http://mail.python.org/pipermail/image-sig/attachments/20050824/3a797759/SdttImagePlugin.bin

More information about the Image-SIG mailing list