mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-14 21:52:56 +08:00
Feature/buildimage.pic2bytes gif support (#1761)
Co-authored-by: unknownsno <110149501+unknownsno@users.noreply.github.com> Co-authored-by: BalconyJH <73932916+BalconyJH@users.noreply.github.com>
This commit is contained in:
parent
64b5316570
commit
cdcca6e761
@ -510,7 +510,13 @@ class BuildImage:
|
||||
bytes: bytes
|
||||
"""
|
||||
buf = BytesIO()
|
||||
self.markImg.save(buf, format="PNG")
|
||||
img_format = self.markImg.format.upper() if self.markImg.format else "PNG"
|
||||
|
||||
if img_format == "GIF":
|
||||
self.markImg.save(buf, format="GIF", save_all=True, loop=0)
|
||||
else:
|
||||
self.markImg.save(buf, format="PNG")
|
||||
|
||||
return buf.getvalue()
|
||||
|
||||
def convert(self, type_: ModeType) -> Self:
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
Loading…
Reference in New Issue
Block a user