[Image-SIG] Image.open problem

Janwillem van Dijk jwevandijk at xs4all.nl
Mon Sep 8 16:17:41 CEST 2008

It all worked nicely but after a re-install of my systems (linux pc, 
linux laptop, windows pc) I have a problem with Image.open(fname). Under 
linux (python2.5 ubuntu 8.04) I get:

Traceback (most recent call last):
  File "/media/DATAWINDOWS/Python/SobelQuality/open_image.py", line 6, 
in <module>
    image = Image.open(fname)
  File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1902, in open
    return factory(fp, filename)
  File "/usr/lib/python2.5/site-packages/PIL/ImageFile.py", line 82, in 
  File "/usr/lib/python2.5/site-packages/PIL/JpegImagePlugin.py", line 
270, in _open
    handler(self, i)
  File "/usr/lib/python2.5/site-packages/PIL/JpegImagePlugin.py", line 
154, in DQT
    self.quantization[v&15] = array.array("b", s[1:65])
AttributeError: 'module' object has no attribute 'array'

with this simple test script:
#open test image
import sys, os.path, time
from PIL import Image
t = time.time()
fname = os.path.join(sys.path[0],'lena.jpg')
image = Image.open(fname)
print 'Open %s width,height %d,%d took %.3f sec' % \

On windows XP it works as it should.

What went wrong and how to get it running again

many thanks,

More information about the Image-SIG mailing list