mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Moved test_wrong_bits_per_sample to test_file_libtiff.py
This commit is contained in:
parent
510de501ea
commit
412f5a5233
|
@ -986,6 +986,36 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
) as im:
|
) as im:
|
||||||
assert_image_equal_tofile(im, "Tests/images/old-style-jpeg-compression.png")
|
assert_image_equal_tofile(im, "Tests/images/old-style-jpeg-compression.png")
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"file_name,mode,size,tile",
|
||||||
|
[
|
||||||
|
(
|
||||||
|
"tiff_wrong_bits_per_sample.tiff",
|
||||||
|
"RGBA",
|
||||||
|
(52, 53),
|
||||||
|
[("raw", (0, 0, 52, 53), 160, ("RGBA", 0, 1))],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"tiff_wrong_bits_per_sample_2.tiff",
|
||||||
|
"RGB",
|
||||||
|
(16, 16),
|
||||||
|
[("raw", (0, 0, 16, 16), 8, ("RGB", 0, 1))],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"tiff_wrong_bits_per_sample_3.tiff",
|
||||||
|
"RGBA",
|
||||||
|
(512, 256),
|
||||||
|
[("libtiff", (0, 0, 512, 256), 0, ("RGBA", "tiff_lzw", False, 48782))],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_wrong_bits_per_sample(self, file_name, mode, size, tile):
|
||||||
|
with Image.open("Tests/images/" + file_name) as im:
|
||||||
|
assert im.mode == mode
|
||||||
|
assert im.size == size
|
||||||
|
assert im.tile == tile
|
||||||
|
im.load()
|
||||||
|
|
||||||
def test_no_rows_per_strip(self):
|
def test_no_rows_per_strip(self):
|
||||||
# This image does not have a RowsPerStrip TIFF tag
|
# This image does not have a RowsPerStrip TIFF tag
|
||||||
infile = "Tests/images/no_rows_per_strip.tif"
|
infile = "Tests/images/no_rows_per_strip.tif"
|
||||||
|
|
|
@ -100,36 +100,6 @@ class TestFileTiff:
|
||||||
with Image.open("Tests/images/hopper_bigtiff.tif") as im:
|
with Image.open("Tests/images/hopper_bigtiff.tif") as im:
|
||||||
assert_image_equal_tofile(im, "Tests/images/hopper.tif")
|
assert_image_equal_tofile(im, "Tests/images/hopper.tif")
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
"file_name,mode,size,tile",
|
|
||||||
[
|
|
||||||
(
|
|
||||||
"tiff_wrong_bits_per_sample.tiff",
|
|
||||||
"RGBA",
|
|
||||||
(52, 53),
|
|
||||||
[("raw", (0, 0, 52, 53), 160, ("RGBA", 0, 1))],
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"tiff_wrong_bits_per_sample_2.tiff",
|
|
||||||
"RGB",
|
|
||||||
(16, 16),
|
|
||||||
[("raw", (0, 0, 16, 16), 8, ("RGB", 0, 1))],
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"tiff_wrong_bits_per_sample_3.tiff",
|
|
||||||
"RGBA",
|
|
||||||
(512, 256),
|
|
||||||
[("libtiff", (0, 0, 512, 256), 0, ("RGBA", "tiff_lzw", False, 48782))],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
def test_wrong_bits_per_sample(self, file_name, mode, size, tile):
|
|
||||||
with Image.open("Tests/images/" + file_name) as im:
|
|
||||||
assert im.mode == mode
|
|
||||||
assert im.size == size
|
|
||||||
assert im.tile == tile
|
|
||||||
im.load()
|
|
||||||
|
|
||||||
def test_set_legacy_api(self):
|
def test_set_legacy_api(self):
|
||||||
ifd = TiffImagePlugin.ImageFileDirectory_v2()
|
ifd = TiffImagePlugin.ImageFileDirectory_v2()
|
||||||
with pytest.raises(Exception) as e:
|
with pytest.raises(Exception) as e:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user