This commit is contained in:
bakatrouble 2019-11-12 20:44:57 +03:00
parent 58168a90b0
commit 4df9c68d78

View File

@ -42,7 +42,9 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
im.thumbnail((2000, 2000)) im.thumbnail((2000, 2000))
with tempfile.TemporaryDirectory() as d: with tempfile.TemporaryDirectory() as d:
fpath = os.path.join(d, '{}.jpg'.format(uuid4())) 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')) self.bot.get_bot().send_photo(self.chat_id, open(fpath, 'rb'))
return True return True