[Image-SIG] Image.open won't work after reload(Image)

Anatoliy Kats akats at cs.toronto.edu
Wed Mar 31 18:58:03 CEST 2010


Hi all,

I'm not sure if this is a known bug.  If I reload(Image), then opening 
the image will not work under Python 2.6 on Ubuntu 9.04.  Here is my 
console output:

 >>> import Image
 >>> im = 
Image.open('/w/197/visionData1/bahenHallway/peopleSeq3/frame1300.ppm')
 >>> import numpy as np
 >>> im2 = np.asarray(im);
 >>> im2[[1:10], [1:10]]
  File "<stdin>", line 1
    im2[[1:10], [1:10]]
          ^
SyntaxError: invalid syntax
 >>> im2[1:10][:, 1:10]
array([[[255, 239, 216],
        [255, 243, 219],
        [255, 246, 222],
        [255, 248, 223],
        [255, 251, 225],
        [255, 252, 226],
        [255, 253, 227],
        [255, 253, 226],
        [255, 250, 223]],
...ETC...

 dtype=uint8)
 >>> reload(Image)
<module 'Image' from '/usr/lib/python2.6/dist-packages/PIL/Image.pyc'>
 >>> im = 
Image.open('/w/197/visionData1/bahenHallway/peopleSeq3/frame1300.ppm')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1917, in open
    raise IOError("cannot identify image file")
IOError: cannot identify image file
 >>> im3 = 
Image.open('/w/197/visionData1/bahenHallway/peopleSeq3/frame1300.ppm')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1917, in open
    raise IOError("cannot identify image file")
IOError: cannot identify image file
 >>>


More information about the Image-SIG mailing list