__ui_image_from_pil_image__ Assumed that the PIL image has a format, which is not the case for generated images
The proposed change uses PNG as the conversion format regardless of the original format of the image, if there was any. Hence the routine now works with generated images as well.
@@ -4208,7 +4208,7 @@ def __ui_image_from_pil_image__(image):
return None
buffered = BytesIO()
- image.save(buffered, format=image.format)
+ image.save(buffered, format='PNG')
img_str = base64.b64encode(buffered.getvalue())
data = __NSData__.alloc().initWithBase64EncodedString(img_str, options=0)
