SimpleCV
SimpleCV copied to clipboard
Simply fix the Image init problem with StringIO
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)