Rune Strand wrote:

> Because of my lousy code/PIL newbieness or something completely 
> different, Windows Python 2.4.3 crashes (in _imaging.pyd) after a call 
> to  Image.putdata(a_list_of_ints).

after some digging, this appears to be a bug in how putdata behaves on 
memory-mapped images.  the simplest way to work around this is to do:

     img = Image.open(bmp_file)

     img = img.copy() # make sure we have a writable copy

if you want to be a bit more careful, you can do:

     # make sure putdata can write to the image memory
     img.load()
     if img.readonly:
         img = img.copy()

     img.putdata(...)

hope this helps!

</F>

_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to