Re: bug in PIL 1.1.7 Image.split()

Fredrik Lundh <[email protected]>
Newsgroups gmane.comp.python.image
Message-ID <[email protected]>
A patch for this can be found here:

    http://hg.effbot.org/pil-2009-raclette/changeset/fb7ce579f5f9

</F>

On Fri, Dec 11, 2009 at 12:55 AM, Fredrik Lundh <[email protected]> wrote:
> Good catch. The breakage is caused by a 1.1.7 fix that treats
> single-band images as a special case; unfortunately, the fix checks
> that attribute before actually loading the image...  I'll provide a
> patch later, but you can of course work around it by adding an
> explicit load to your code.
>
> Thanks /F
>
> On Thu, Dec 10, 2009 at 10:48 AM, Bill Janssen <[email protected]> wrote:
>> Just stumbled over this bug.  Shouldn't split() do a load() first?  This
>> used to work in 1.1.6.
>>
>> Bill
>>
>> % python
>> Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12)
>> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import Image
>>>>> Image.VERSION
>> '1.1.7'
>>>>> im = Image.open("/u/extensions/vCardParser/vcardimage.png")
>>>>> im.mode
>> 'RGBA'
>>>>> im.size
>> (200, 138)
>>>>> im.split()
>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>>  File "/Library/Python/2.5/site-packages/PIL/Image.py", line 1497, in split
>>    if self.im.bands == 1:
>> AttributeError: 'NoneType' object has no attribute 'bands'
>>>>>
>> _______________________________________________
>> Image-SIG maillist  -  [email protected]
>> http://mail.python.org/mailman/listinfo/image-sig
>>
>
_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.