InLaTeXbot icon indicating copy to clipboard operation
InLaTeXbot copied to clipboard

Higher resolution of images

Open xamgore opened this issue 7 years ago • 9 comments

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 :)

xamgore avatar Sep 11 '17 21:09 xamgore

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.

vdrhtc avatar Sep 12 '17 09:09 vdrhtc

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

IronPiston avatar Mar 06 '18 19:03 IronPiston

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

vdrhtc avatar Mar 06 '18 23:03 vdrhtc

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.

xamgore avatar Sep 06 '18 10:09 xamgore

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.

vdrhtc avatar Sep 06 '18 14:09 vdrhtc

Well, try to send a message @isthisabot kek:

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

xamgore avatar Sep 06 '18 19:09 xamgore

Oh well, here it is the key =)

default

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

vdrhtc avatar Sep 06 '18 19:09 vdrhtc

@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.

aNNiMON avatar Sep 06 '18 19:09 aNNiMON

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

vdrhtc avatar Sep 06 '18 19:09 vdrhtc