problem with python PIL Image library split function

I'm having problems with python-imaging 1.1.7-1. (1.1.6-3 version works)
Whenever I load a greyscale PNG with Alpha ("LA" bands):

>>> from PIL import Image

>>> i1 = Image.open("testfile.png")

>>> repr(i1.im)
'None' self.im attribute is not loaded yet.
And when I try to call self.split(), i get:


>>> i1.split() Traceback (most recent call last):
File "", line 1, in File "/usr/lib/python2.5/site-packages/PIL/Image.py",
line 1497, in split
if self.im.bands == 1: AttributeError: 'NoneType' object has no attribute 'bands'
Image.split function isn't checking if im attribute is loaded,
and whenever I open a PNG it remains unloaded.
I have solved it in my program calling Image.load() just after open.
But the bug remains.
>>> i1.load()
>>> repr(i1.im) ''
>>> i1.split() (, )

0 comments:

Post a Comment