Merge pull request #15738 from JLipnerPitt/JLipnerPitt-patch-1

Fix AttributeError
This commit is contained in:
AUTOMATIC1111 2024-06-08 11:32:38 +03:00 committed by GitHub
commit c1c4b3fb34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -789,7 +789,10 @@ def read_info_from_image(image: Image.Image) -> tuple[str | None, dict]:
if exif_comment:
geninfo = exif_comment
elif "comment" in items: # for gif
if isinstance(items["comment"], bytes):
geninfo = items["comment"].decode('utf8', errors="ignore")
else:
geninfo = items["comment"]
for field in IGNORED_INFO_KEYS:
items.pop(field, None)