diff --git a/Tests/test_image_putdata.py b/Tests/test_image_putdata.py index 036ee285f..acea0d62a 100644 --- a/Tests/test_image_putdata.py +++ b/Tests/test_image_putdata.py @@ -46,6 +46,26 @@ class TestImagePutData(PillowTestCase): im = Image.new('L', (256,256)) im.putdata(list(range(256))*256) + def test_mode_i(self): + src = lena('L') + data = list(src.getdata()) + im = Image.new('I', src.size, 0) + im.putdata(data, 2, 256) + + target = [2* elt + 256 for elt in data] + self.assertEqual(list(im.getdata()), target) + + def test_mode_F(self): + src = lena('L') + data = list(src.getdata()) + im = Image.new('F', src.size, 0) + im.putdata(data, 2.0, 256.0) + + target = [2.0* float(elt) + 256.0 for elt in data] + self.assertEqual(list(im.getdata()), target) + + + if __name__ == '__main__': unittest.main()