diff --git a/PIL/IcoImagePlugin.py b/PIL/IcoImagePlugin.py index 82d33e383..268e93d6c 100644 --- a/PIL/IcoImagePlugin.py +++ b/PIL/IcoImagePlugin.py @@ -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 # # -------------------------------------------------------------------- diff --git a/Tests/images/python.ico b/Tests/images/python.ico new file mode 100644 index 000000000..c9efc5844 Binary files /dev/null and b/Tests/images/python.ico differ diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py index d602935e7..12061eb0e 100644 --- a/Tests/test_imagefile.py +++ b/Tests/test_imagefile.py @@ -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()