mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 10:16:17 +03:00
More tests for ico save
This commit is contained in:
parent
79c7c7a01a
commit
03d20d3b6a
|
@ -22,13 +22,27 @@ class TestFileIco(PillowTestCase):
|
||||||
im = hopper()
|
im = hopper()
|
||||||
im.save(output, "ico", sizes=[(32, 32), (64, 64)])
|
im.save(output, "ico", sizes=[(32, 32), (64, 64)])
|
||||||
|
|
||||||
|
# the default image
|
||||||
output.seek(0)
|
output.seek(0)
|
||||||
reloaded = Image.open(output)
|
reloaded = Image.open(output)
|
||||||
|
self.assertEqual(reloaded.info['sizes'],set([(32, 32), (64, 64)]))
|
||||||
|
|
||||||
self.assertEqual(im.mode, reloaded.mode)
|
self.assertEqual(im.mode, reloaded.mode)
|
||||||
self.assertEqual((64, 64), reloaded.size)
|
self.assertEqual((64, 64), reloaded.size)
|
||||||
self.assertEqual(reloaded.format, "ICO")
|
self.assertEqual(reloaded.format, "ICO")
|
||||||
|
self.assert_image_equal(reloaded, hopper().resize((64,64), Image.ANTIALIAS))
|
||||||
|
|
||||||
|
# the other one
|
||||||
|
output.seek(0)
|
||||||
|
reloaded = Image.open(output)
|
||||||
|
reloaded.size = (32,32)
|
||||||
|
|
||||||
|
self.assertEqual(im.mode, reloaded.mode)
|
||||||
|
self.assertEqual((32, 32), reloaded.size)
|
||||||
|
self.assertEqual(reloaded.format, "ICO")
|
||||||
|
self.assert_image_equal(reloaded, hopper().resize((32,32), Image.ANTIALIAS))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user