mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Use BytesIO instead of StringIO
This commit is contained in:
parent
c768e793a4
commit
b9b6972097
|
@ -1,6 +1,6 @@
|
|||
from PIL import Image
|
||||
from PIL import ImageFile
|
||||
import StringIO
|
||||
from io import BytesIO
|
||||
import _webp
|
||||
|
||||
def _accept(prefix):
|
||||
|
@ -15,7 +15,7 @@ class WebPImageFile(ImageFile.ImageFile):
|
|||
self.mode = "RGB"
|
||||
data, width, height = _webp.WebPDecodeRGB(self.fp.read())
|
||||
self.size = width, height
|
||||
self.fp = StringIO.StringIO(data)
|
||||
self.fp = BytesIO(data)
|
||||
self.tile = [("raw", (0, 0) + self.size, 0, 'RGB')]
|
||||
|
||||
def _save(im, fp, filename):
|
||||
|
|
Loading…
Reference in New Issue
Block a user