mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
44 lines
1.0 KiB
Python
44 lines
1.0 KiB
Python
from helper import unittest, PillowTestCase, lena
|
|
|
|
|
|
class TestImageThumbnail(PillowTestCase):
|
|
|
|
def test_sanity(self):
|
|
|
|
im = lena()
|
|
im.thumbnail((100, 100))
|
|
|
|
self.assert_image(im, im.mode, (100, 100))
|
|
|
|
def test_aspect(self):
|
|
|
|
im = lena()
|
|
im.thumbnail((100, 100))
|
|
self.assert_image(im, im.mode, (100, 100))
|
|
|
|
im = lena().resize((128, 256))
|
|
im.thumbnail((100, 100))
|
|
self.assert_image(im, im.mode, (50, 100))
|
|
|
|
im = lena().resize((128, 256))
|
|
im.thumbnail((50, 100))
|
|
self.assert_image(im, im.mode, (50, 100))
|
|
|
|
im = lena().resize((256, 128))
|
|
im.thumbnail((100, 100))
|
|
self.assert_image(im, im.mode, (100, 50))
|
|
|
|
im = lena().resize((256, 128))
|
|
im.thumbnail((100, 50))
|
|
self.assert_image(im, im.mode, (100, 50))
|
|
|
|
im = lena().resize((128, 128))
|
|
im.thumbnail((100, 100))
|
|
self.assert_image(im, im.mode, (100, 100))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|
|
|
|
# End of file
|