aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJJ <jjisnow@gmail.com>2022-09-14 10:38:40 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2022-09-14 12:14:26 +0000
commitc4e90bf6893eb61cbc9f5a8bcc71aa4a2c344d8f (patch)
tree8440d346637b633052203207155f5a18014158e9
parentc9430e53f6bad9af8adbc35ff72bcf59fbdec0ef (diff)
downloadstable-diffusion-webui-gfx803-c4e90bf6893eb61cbc9f5a8bcc71aa4a2c344d8f.tar.gz
stable-diffusion-webui-gfx803-c4e90bf6893eb61cbc9f5a8bcc71aa4a2c344d8f.tar.bz2
stable-diffusion-webui-gfx803-c4e90bf6893eb61cbc9f5a8bcc71aa4a2c344d8f.zip
format exif string
* UserComment needs an ID code at the start of the tag area. This is provided by piexif.helper.UserComment, otherwise an "Warning Invalid EXIF text encoding for UserComment" is thrown upon reading the exif data
-rw-r--r--modules/images.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/images.py b/modules/images.py
index d48a8ab2..db68f405 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -325,8 +325,8 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
if extension.lower() in ("jpg", "jpeg", "webp"):
exif_bytes = piexif.dump({
"Exif": {
- piexif.ExifIFD.UserComment: info.encode("utf8"),
- }
+ piexif.ExifIFD.UserComment: piexif.helper.UserComment.dump(info)
+ },
})
else:
exif_bytes = None