mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-21 09:41:59 +03:00
Merge PR1839 into hack202406
This commit is contained in:
commit
9cbb840861
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.
|
@ -874,6 +874,19 @@ class TestFileTiff:
|
|||
with Image.open(test_file):
|
||||
pass
|
||||
|
||||
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 = f"Tests/images/uint16_{i}_{base_value}.tif"
|
||||
im = Image.open(infile)
|
||||
im.load()
|
||||
pixel = [base_value + j for j in range(0, i)]
|
||||
actual_pixel = im.getpixel((0, 0))
|
||||
if isinstance(actual_pixel, int):
|
||||
actual_pixel = [actual_pixel]
|
||||
assert actual_pixel == pixel
|
||||
|
||||
|
||||
@pytest.mark.skipif(not is_win32(), reason="Windows only")
|
||||
class TestFileTiffW32:
|
||||
|
|
|
@ -182,6 +182,43 @@ OPEN_INFO = {
|
|||
(II, 1, (1,), 1, (12,), ()): ("I;16", "I;12"),
|
||||
(II, 0, (1,), 1, (16,), ()): ("I;16", "I;16"),
|
||||
(II, 1, (1,), 1, (16,), ()): ("I;16", "I;16"),
|
||||
(II, 1, (1,), 1, (16, 16), (0,)): ("I;16", "I;16"),
|
||||
(
|
||||
II,
|
||||
1,
|
||||
(1,),
|
||||
1,
|
||||
(16, 16, 16),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
),
|
||||
): ("I;16", "I;16"),
|
||||
(
|
||||
II,
|
||||
1,
|
||||
(1,),
|
||||
1,
|
||||
(16, 16, 16, 16),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
): ("I;16", "I;16"),
|
||||
(
|
||||
II,
|
||||
1,
|
||||
(1,),
|
||||
1,
|
||||
(16, 16, 16, 16, 16),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
): ("I;16", "I;16"),
|
||||
(MM, 1, (1,), 1, (16,), ()): ("I;16B", "I;16B"),
|
||||
(II, 1, (1,), 2, (16,), ()): ("I;16", "I;16R"),
|
||||
(II, 1, (2,), 1, (16,), ()): ("I", "I;16S"),
|
||||
|
|
Loading…
Reference in New Issue
Block a user