mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-28 21:13:41 +03:00
Merge pull request #5331 from radarhere/png_bits
Added test for saving PNG with bits keyword
This commit is contained in:
commit
e1e9569d8a
|
@ -625,6 +625,15 @@ class TestFilePng:
|
||||||
with Image.open("Tests/images/hopper_idat_after_image_end.png") as im:
|
with Image.open("Tests/images/hopper_idat_after_image_end.png") as im:
|
||||||
assert im.text == {"TXT": "VALUE", "ZIP": "VALUE"}
|
assert im.text == {"TXT": "VALUE", "ZIP": "VALUE"}
|
||||||
|
|
||||||
|
def test_specify_bits(self, tmp_path):
|
||||||
|
im = hopper("P")
|
||||||
|
|
||||||
|
out = str(tmp_path / "temp.png")
|
||||||
|
im.save(out, bits=4)
|
||||||
|
|
||||||
|
with Image.open(out) as reloaded:
|
||||||
|
assert len(reloaded.png.im_palette[1]) == 48
|
||||||
|
|
||||||
def test_exif(self):
|
def test_exif(self):
|
||||||
# With an EXIF chunk
|
# With an EXIF chunk
|
||||||
with Image.open("Tests/images/exif.png") as im:
|
with Image.open("Tests/images/exif.png") as im:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user