From 4469ee0fc0206326cd6cf016d31ce204342e35db Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 7 Sep 2025 12:25:56 +1000 Subject: [PATCH] Test saving P4 images --- Tests/test_file_ppm.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tests/test_file_ppm.py b/Tests/test_file_ppm.py index 68f2f9468..ca5347f0f 100644 --- a/Tests/test_file_ppm.py +++ b/Tests/test_file_ppm.py @@ -92,6 +92,13 @@ def test_16bit_pgm() -> None: assert_image_equal_tofile(im, "Tests/images/16_bit_binary_pgm.tiff") +def test_p4_save(tmp_path: Path) -> None: + with Image.open("Tests/images/hopper_1bit.pbm") as im: + filename = tmp_path / "temp.pbm" + im.save(filename) + assert_image_equal_tofile(im, filename) + + def test_16bit_pgm_write(tmp_path: Path) -> None: with Image.open("Tests/images/16_bit_binary.pgm") as im: filename = tmp_path / "temp.pgm"