This commit is contained in:
bakatrouble 2019-11-12 20:48:34 +03:00
parent 726ce8ac0e
commit e39bbcf767

View File

@ -44,7 +44,7 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
fpath = os.path.join(d, '{}.jpg'.format(uuid4())) fpath = os.path.join(d, '{}.jpg'.format(uuid4()))
background = Image.new('RGBA', im.size, (255, 255, 255)) background = Image.new('RGBA', im.size, (255, 255, 255))
alpha_composite = Image.alpha_composite(background, im) alpha_composite = Image.alpha_composite(background, im)
alpha_composite.convert('RGB') alpha_composite = alpha_composite.convert('RGB')
alpha_composite.save(fpath) 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