mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-12 01:02:39 +03:00
Add tests for opening 2-5 layer uint16 greyscale TIFFs.
This commit is contained in:
parent
d2a7de2c25
commit
1c2d465589
BIN
Tests/images/uint16_2_4660.tif
Normal file
BIN
Tests/images/uint16_2_4660.tif
Normal file
Binary file not shown.
BIN
Tests/images/uint16_3_4660.tif
Normal file
BIN
Tests/images/uint16_3_4660.tif
Normal file
Binary file not shown.
BIN
Tests/images/uint16_4_4660.tif
Normal file
BIN
Tests/images/uint16_4_4660.tif
Normal file
Binary file not shown.
BIN
Tests/images/uint16_5_4660.tif
Normal file
BIN
Tests/images/uint16_5_4660.tif
Normal file
Binary file not shown.
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user