SimpleCV icon indicating copy to clipboard operation
SimpleCV copied to clipboard

Simply fix the Image init problem with StringIO

Open jcppman opened this issue 12 years ago • 0 comments

Image init with StringIO didn't work because StringIO class doesn't has split() method, which is called by webp determination. To solve this, a judgement is inserted before source.split to exclude that situation, thus it would only be called if source is not a StringIO instance.

To reproduce the bug:

import SimpleCV as scv
import StringIO

img = scv.Image('lenna')
buff = StringIO.StringIO
img.save(buff)

buff.seek(0)
new_image = scv.Image(buff)

jcppman avatar Dec 12 '13 09:12 jcppman