Commit c4e90bf6 authored by JJ's avatar JJ Committed by AUTOMATIC1111

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
parent c9430e53
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment