Add tests for opening 2-5 layer uint16 greyscale TIFFs.

This commit is contained in:
Bryant Mairs 2016-04-18 19:56:26 -07:00
parent d2a7de2c25
commit 1c2d465589
5 changed files with 13 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -450,6 +450,19 @@ class TestFileTiff(PillowTestCase):
# Should not raise UnicodeDecodeError or anything else # Should not raise UnicodeDecodeError or anything else
im.save(outfile) im.save(outfile)
def test_open_tiff_uint16_multiband(self):
"""Test opening multiband TIFFs and reading all channels."""
base_value = 4660
for i in range(2, 6):
infile = "Tests/images/uint16_{}_{}.tif".format(i, base_value)
im = Image.open(infile)
im.load()
pixel = [base_value + j for j in range(0, i)]
actual_pixel = im.getpixel((0,0))
if type(actual_pixel) is int:
actual_pixel = [actual_pixel]
self.assertEqual(actual_pixel, pixel)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()