Skip to content

Commit c2e9c66

Browse files
committed
Add tests for 4-bit RLE decoder
1 parent 70e3e4f commit c2e9c66

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Tests/images/hopper_4bit.bmp

8.12 KB
Binary file not shown.

Tests/images/hopper_rle4.bmp

7.95 KB
Binary file not shown.

Tests/test_file_bmp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ def test_rle8():
175175
with pytest.raises(ValueError):
176176
im.load()
177177

178+
def test_rle4():
179+
with Image.open("Tests/images/hopper_rle4.bmp") as im:
180+
assert_image_similar_tofile(im, "Tests/images/hopper_4bit.bmp", 12)
181+
182+
with Image.open("Tests/images/bmp/g/pal4rle.bmp") as im:
183+
assert_image_similar_tofile(im, "Tests/images/bmp/g/pal4.bmp", 12)
184+
178185

179186
@pytest.mark.parametrize(
180187
"file_name,length",

0 commit comments

Comments
 (0)