Skip to content

Commit 5af987b

Browse files
committed
Added test for saving PNG with bits keyword
1 parent 8064e04 commit 5af987b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Tests/test_file_png.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,15 @@ def test_textual_chunks_after_idat(self):
625625
with Image.open("Tests/images/hopper_idat_after_image_end.png") as im:
626626
assert im.text == {"TXT": "VALUE", "ZIP": "VALUE"}
627627

628+
def test_specify_bits(self, tmp_path):
629+
im = hopper("P")
630+
631+
out = str(tmp_path / "temp.png")
632+
im.save(out, bits=7)
633+
634+
with Image.open(out) as reloaded:
635+
assert len(reloaded.png.im_palette[1]) == 384
636+
628637
def test_exif(self):
629638
# With an EXIF chunk
630639
with Image.open("Tests/images/exif.png") as im:

0 commit comments

Comments
 (0)