mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-12-16 13:40:53 +08:00
fix bug
This commit is contained in:
parent
ef00094b8f
commit
20e9b3659e
@ -28,6 +28,7 @@ class MessageBuild:
|
||||
if isinstance(img, str) or isinstance(img, Path):
|
||||
img = load_image(path=img, size=size, mode=mode, crop=crop)
|
||||
bio = BytesIO()
|
||||
img = img.convert(mode)
|
||||
img.save(bio, format='JPEG' if mode == 'RGB' else 'PNG', quality=quality)
|
||||
img_b64 = 'base64://' + base64.b64encode(bio.getvalue()).decode()
|
||||
return MessageSegment.image(img_b64)
|
||||
|
Loading…
x
Reference in New Issue
Block a user