mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
py3k: Add Windows icon sanity test
This commit is contained in:
parent
276cc421f7
commit
848579af9b
BIN
Images/lena.ico
Normal file
BIN
Images/lena.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -49,7 +49,7 @@ class IcoImageFile(BmpImagePlugin.BmpImageFile):
|
|||
raise SyntaxError("not an ICO file")
|
||||
|
||||
# pick the largest icon in the file
|
||||
m = ""
|
||||
m = b""
|
||||
for i in range(i16(s[4:])):
|
||||
s = self.fp.read(16)
|
||||
if not m:
|
||||
|
|
14
Tests/test_file_ico.py
Normal file
14
Tests/test_file_ico.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from tester import *
|
||||
|
||||
from PIL import Image
|
||||
|
||||
# sample ppm stream
|
||||
file = "Images/lena.ico"
|
||||
data = open(file, "rb").read()
|
||||
|
||||
def test_sanity():
|
||||
im = Image.open(file)
|
||||
im.load()
|
||||
assert_equal(im.mode, "P")
|
||||
assert_equal(im.size, (16, 16))
|
||||
assert_equal(im.format, "ICO")
|
Loading…
Reference in New Issue
Block a user