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
This commit is contained in:
JJ 2022-09-14 20:38:40 +10:00 committed by AUTOMATIC1111
parent c9430e53f6
commit c4e90bf689

View File

@ -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