[Image-SIG] problem with .ras files

Pablo Cavalcanti pgcavalcanti at gmail.com
Wed Mar 28 16:35:33 CEST 2007


Hello, this is my first email in this list.
I am trying to read the pixels of some .ras files, but an IndexError always
happens.

>>> import Image
>>> im = Image.open("C:/argus/etc/test.ras")
>>> im
<SunImagePlugin.SunImageFile instance at 0x016A78F0>
>>> data = im.getdata()

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in -toplevel-
    data = im.getdata()
  File "C:\Python24\Lib\site-packages\PIL\Image.py", line 860, in getdata
    self.load()
  File "C:\Python24\Lib\site-packages\PIL\ImageFile.py", line 138, in load
    self.im = self.map.readimage(
IndexError: tuple index out of range
>>> im.getpixel((50,50))

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in -toplevel-
    im.getpixel((50,50))
  File "C:\Python24\Lib\site-packages\PIL\Image.py", line 922, in getpixel
    self.load()
  File "C:\Python24\Lib\site-packages\PIL\ImageFile.py", line 138, in load
    self.im = self.map.readimage(
IndexError: tuple index out of range

Anybody can help me?

Thanks and sorry about my bad English...

  Pablo Cavalcanti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/image-sig/attachments/20070328/31520d68/attachment.html 


More information about the Image-SIG mailing list