Merge PR1839 into hack202406

This commit is contained in:
Junxiao Shi 2024-06-01 12:09:02 +00:00
commit 9cbb840861
6 changed files with 50 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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:

View File

@ -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"),