fix png
This commit is contained in:
parent
58168a90b0
commit
4df9c68d78
@ -42,7 +42,9 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
|
||||
im.thumbnail((2000, 2000))
|
||||
with tempfile.TemporaryDirectory() as d:
|
||||
fpath = os.path.join(d, '{}.jpg'.format(uuid4()))
|
||||
im.save(fpath)
|
||||
background = Image.new('RGBA', im.size, (255, 255, 255))
|
||||
alpha_composite = Image.alpha_composite(background, im)
|
||||
alpha_composite.save(fpath)
|
||||
self.bot.get_bot().send_photo(self.chat_id, open(fpath, 'rb'))
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user