[Image-SIG] Image.split broken when image file isn't loaded

Chris Lamb lamby at debian.org
Wed Dec 9 15:51:22 CET 2009


Hi,

Image.split appears to be broken when the image file isn't loaded first.

My testcase is:

  >>> from PIL import Image
  >>> x = Image.open('test.png')
  >>> x.split()
  [..]
  AttributeError: 'NoneType' object has no attribute 'bands'

I think Image.point was broken in the same way recently; the client
workaround of calling Image.load works here too.

Patch attached.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org
       `-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-split.diff
Type: text/x-patch
Size: 600 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/image-sig/attachments/20091209/18db48a3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/image-sig/attachments/20091209/18db48a3/attachment.pgp>


More information about the Image-SIG mailing list