From e736c3b36b5e450c3883719d1b73acf84bdf29f7 Mon Sep 17 00:00:00 2001 From: JLipnerPitt <122459494+JLipnerPitt@users.noreply.github.com> Date: Wed, 8 May 2024 05:22:12 -0400 Subject: [PATCH] Add files via upload Fixed an error (AttributeError: 'str' object has no attribute 'decode') coming from line 792 in images.py when trying to upscale certain images. --- modules/images.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/images.py b/modules/images.py index c0ff8a630..0f49caf79 100644 --- a/modules/images.py +++ b/modules/images.py @@ -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 - geninfo = items["comment"].decode('utf8', errors="ignore") + 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)