diff --git a/Tests/images/uint16_1_4660.tif b/Tests/images/uint16_1_4660.tif new file mode 100644 index 000000000..86360be8d Binary files /dev/null and b/Tests/images/uint16_1_4660.tif differ diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 84fdd0f49..924ceeca4 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -450,6 +450,13 @@ class TestFileTiff(PillowTestCase): # Should not raise UnicodeDecodeError or anything else im.save(outfile) + def test_open_tiff_uint16(self): + # Test an image of all '0' values + pixel_value = 0x1234 + infile = "Tests/images/uint16_1_{}.tif".format(pixel_value) + im = Image.open(infile) + self.assertEqual(im.getpixel((0, 0)), pixel_value) + if __name__ == '__main__': unittest.main() diff --git a/Tests/test_numpy.py b/Tests/test_numpy.py index 29323b45a..27cbbb7ca 100644 --- a/Tests/test_numpy.py +++ b/Tests/test_numpy.py @@ -106,6 +106,21 @@ class TestNumpy(PillowTestCase): self._test_img_equals_nparray(img, np_img) self.assertEqual(np_img.dtype, numpy.dtype('