vdrhtc / InLaTeXbot

Customizable LaTeX bot for Telegram messenger
http://t.me/InLaTeXbot
GNU General Public License v3.0
216 stars 11 forks source link

Higher resolution of images #2

Open xamgore opened 7 years ago

xamgore commented 7 years ago

Hi, there! Thank you for the bot, it is super useful for our math club!

Though, there are some problems with it: image

Same with mobile telegram client.

I think, that bot should send images either in webp format (so telegram will not resize it), or change resolution up. I would love to make a PR, but actually don't have a free time (hard study in a university).

Thank you for your attention :)

vdrhtc commented 7 years ago

Hi, thanks for the feedback!

You can customize the resolution using this command:

default

Just sent it "\setdpi 1000" to increase the resolution

I've chosen a smaller default DPI (100, I think) so that messages would have the same font size as the Telegram's font itself. While it's okay when the queries are long enough, it may look not so good when they are short, just as you say.. Maybe I should change the default DPI to a higher value.

IronPiston commented 6 years ago

I've tried setting the dpi, and can't get the resolution to change. Would I need to enter @inlatexbot \setdpi 1000 ?

vdrhtc commented 6 years ago

Well, everything works for me.. Send me a screenshot so I can see the problem. (@inlatexbot \setdpi 1000 will certainly not work, you should send him the message directly)

default

xamgore commented 6 years ago

Maybe it's better to send not images but stickers (sendImage or sendSticker method, but with "webp" extension)? They support transparent background and usually have much better quality. Though restriction is 500×500 Max resolution.

vdrhtc commented 6 years ago

xamgore, unfortunately, I don't think that's possible. It's not in the inline mode functionality. Moreover, the bot would then have to generate and upload a sticker to some sticker pack for each query, so you can imagine how large it would get through time.

xamgore commented 6 years ago

Well, try to send a message @isthisabot kek:

@aNNiMON is the author, he can describe how he implemented the bot.

vdrhtc commented 6 years ago

Oh well, here it is the key =)

default

Very nice, actually, I'll try to implement that in my spare time

aNNiMON commented 6 years ago

@vdrhtc you don't need to create sticker packs, just generate webp image and upload it as document. There is a limitation in Bots API that you can't create new stickers in inline mode. But you can post new sticker to private channel to generate sticker's file_id and then return InlineQueryResultCachedSticker to user.

vdrhtc commented 6 years ago

@aNNiMON Thanks! Yeah, that's pretty much the same thing I do with plain images =))