diff --git a/Tests/images/uint16_2_4660.tif b/Tests/images/uint16_2_4660.tif new file mode 100644 index 000000000..188ff2af7 Binary files /dev/null and b/Tests/images/uint16_2_4660.tif differ diff --git a/Tests/images/uint16_3_4660.tif b/Tests/images/uint16_3_4660.tif new file mode 100644 index 000000000..3c2bc8658 Binary files /dev/null and b/Tests/images/uint16_3_4660.tif differ diff --git a/Tests/images/uint16_4_4660.tif b/Tests/images/uint16_4_4660.tif new file mode 100644 index 000000000..ae8252d78 Binary files /dev/null and b/Tests/images/uint16_4_4660.tif differ diff --git a/Tests/images/uint16_5_4660.tif b/Tests/images/uint16_5_4660.tif new file mode 100644 index 000000000..df92724c3 Binary files /dev/null and b/Tests/images/uint16_5_4660.tif differ diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 84fdd0f49..245959d3a 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -450,6 +450,19 @@ class TestFileTiff(PillowTestCase): # Should not raise UnicodeDecodeError or anything else 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__': unittest.main()