Save comments from any image format by default

This commit is contained in:
Andrew Murray 2022-12-03 09:29:02 +11:00
parent e9f4858491
commit 976ad5746a

View File

@ -714,9 +714,7 @@ def _save(im, fp, filename):
extra = info.get("extra", b"")
comment = info.get("comment")
if comment is None and isinstance(im, JpegImageFile):
comment = im.app.get("COM")
comment = info.get("comment", im.info.get("comment"))
if comment:
if isinstance(comment, str):
comment = comment.encode()