fix test which relied on old bugs

This commit is contained in:
homm 2016-07-11 01:47:25 +03:00
parent 5b8c8aa389
commit 2221a6467c
3 changed files with 8 additions and 8 deletions

View File

@ -1877,7 +1877,7 @@ class Image(object):
xs = float(x1 - x0) / w
ys = float(y1 - y0) / h
method = AFFINE
data = (xs, 0, x0 + xs/2, 0, ys, y0 + ys/2)
data = (xs, 0, x0, 0, ys, y0)
elif method == PERSPECTIVE:
data = data[0:8]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -20,13 +20,13 @@ class TestImageGetData(PillowTestCase):
return data[0], len(data), len(list(data))
self.assertEqual(getdata("1"), (0, 960, 960))
self.assertEqual(getdata("L"), (25, 960, 960))
self.assertEqual(getdata("I"), (25, 960, 960))
self.assertEqual(getdata("F"), (25.0, 960, 960))
self.assertEqual(getdata("RGB"), (((20, 20, 70), 960, 960)))
self.assertEqual(getdata("RGBA"), ((20, 20, 70, 255), 960, 960))
self.assertEqual(getdata("CMYK"), ((235, 235, 185, 0), 960, 960))
self.assertEqual(getdata("YCbCr"), ((25, 153, 123), 960, 960))
self.assertEqual(getdata("L"), (16, 960, 960))
self.assertEqual(getdata("I"), (16, 960, 960))
self.assertEqual(getdata("F"), (16.0, 960, 960))
self.assertEqual(getdata("RGB"), (((11, 13, 52), 960, 960)))
self.assertEqual(getdata("RGBA"), ((11, 13, 52, 255), 960, 960))
self.assertEqual(getdata("CMYK"), ((244, 242, 203, 0), 960, 960))
self.assertEqual(getdata("YCbCr"), ((16, 147, 123), 960, 960))
if __name__ == '__main__':