A PIL Question

Ray ray_usenet at yahoo.com
Sun Aug 14 13:34:38 EDT 2005


Hello,

I'm using latest PIL version with Python 2.4.1. (for solving a level in
Python Challenge actually...). Anyway, I'm trying to draw a picture. My
question is, why is it that putdata() won't work? Even this won't run:

import Image

im = Image.open("something.jpg")
seq = im.getdata()

image = Image.Image()
image.putdata(seq)

image.show()

I always get:

Traceback (most recent call last):
  File "Script1.py", line 31, in ?
    image.putdata(seq)
  File "D:\Development\Python24\Lib\site-packages\PIL\Image.py", line
1120, in putdata
    self.im.putdata(data, scale, offset)
AttributeError: 'NoneType' object has no attribute 'putdata'

Anybody has any idea why this is the case? 

Thanks,
Ray




More information about the Python-list mailing list