mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +03:00
Make ICO files work with the ImageFile.Parser interface, fixes #522
This commit is contained in:
parent
cb309c9f59
commit
36323d1140
|
@ -222,6 +222,10 @@ class IcoImageFile(ImageFile.ImageFile):
|
|||
self.mode = im.mode
|
||||
self.size = im.size
|
||||
|
||||
|
||||
def load_seek(self):
|
||||
# Flage the ImageFile.Parser so that it just does all the decode at the end.
|
||||
pass
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
|
|
BIN
Tests/images/python.ico
Normal file
BIN
Tests/images/python.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
|
@ -57,6 +57,13 @@ def test_parser():
|
|||
# https://github.com/python-imaging/Pillow/issues/78
|
||||
#assert_exception(IOError, lambda: roundtrip("PDF"))
|
||||
|
||||
def test_ico():
|
||||
with open('Tests/images/python.ico', 'rb') as f:
|
||||
data = f.read()
|
||||
p = ImageFile.Parser()
|
||||
p.feed(data)
|
||||
assert_equal((48,48), p.image.size)
|
||||
|
||||
def test_safeblock():
|
||||
|
||||
im1 = lena()
|
||||
|
|
Loading…
Reference in New Issue
Block a user