classification
Title: PIL Bug with split
Type: behavior Stage: committed/rejected
Components: Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Arrnaud.Fabre, ezio.melotti
Priority: normal Keywords:

Created on 2010-07-26 15:08 by Arrnaud.Fabre, last changed 2010-07-26 15:10 by ezio.melotti. This issue is now closed.

Messages (2)
msg111630 - (view) Author: Arrnaud Fabre (Arrnaud.Fabre) Date: 2010-07-26 15:08
>>> import Image
>>> im = Image.open('whatever')
>>> im.split()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1497, in split
    if self.im.bands == 1:
AttributeError: 'NoneType' object has no attribute 'bands'

Bug can be fixed by using getdata before split() :

>>> import Image
>>> im = Image.open('whatever')
>>> im.getdata()
<ImagingCore object at 0x7fad913c0090>
>>> im.split()
(<Image.Image image mode=L size=360x480 at 0x1CAE320>, <Image.Image image mode=L size=360x480 at 0x1CAE368>, <Image.Image image mode=L size=360x480 at 0x1CAE3B0>)
msg111633 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-07-26 15:10
You should report this on the PIL bug tracker. PIL is not part of the Python standard library.
History
Date User Action Args
2010-07-26 15:10:26ezio.melottisetstatus: open -> closed

type: crash -> behavior

nosy: + ezio.melotti
messages: + msg111633
resolution: not a bug
stage: committed/rejected
2010-07-26 15:08:30Arrnaud.Fabrecreate