mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
make sure passing a blank comment removes existing comment
This commit is contained in:
parent
e71f7c1083
commit
1ed1a3a971
|
@ -98,6 +98,13 @@ class TestFileJpeg:
|
||||||
with Image.open(out) as reloaded:
|
with Image.open(out) as reloaded:
|
||||||
assert im.info["comment"] == reloaded.info["comment"]
|
assert im.info["comment"] == reloaded.info["comment"]
|
||||||
|
|
||||||
|
# Ensure that a blank comment causes any existing comment to be removed
|
||||||
|
for comment in ("", b"", None):
|
||||||
|
out = BytesIO()
|
||||||
|
im.save(out, format="JPEG", comment=comment)
|
||||||
|
with Image.open(out) as reloaded:
|
||||||
|
assert "comment" not in reloaded.info
|
||||||
|
|
||||||
# Test that a comment argument overrides the default comment
|
# Test that a comment argument overrides the default comment
|
||||||
for comment in ("Test comment text", b"Text comment text"):
|
for comment in ("Test comment text", b"Text comment text"):
|
||||||
out = BytesIO()
|
out = BytesIO()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user