如何从电报中获取真实尺寸(而不是拇指)的照片? [英] How to get photo in real size (not thumb) from telegram?
本文介绍了如何从电报中获取真实尺寸(而不是拇指)的照片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用getFile(),然后使用诸如https://api.telegram.org/file/bot<token>/<file_path>.
的链接下载照片
但是我只收到他的缩略图
I am using getFile() and then download photo with a link like https://api.telegram.org/file/bot<token>/<file_path>.
But I received only his thumbnails
有人可以问我如何下载真实尺寸的照片吗?
Can anyone ask me how to download photo in real size?
推荐答案
您从Telegram收到的photo
对象包含一个数组,其中file_id
的大小不同.索引越高,大小越大,因此您只需要选择正确的file_id
The photo
object you receive from Telegram contains an array with the file_id
of different sizes. The higher the index, the bigger the size, so you just need to pick the right file_id
.
它可能看起来像这样:
[{
"file_id":"AgADBAADxxxx",
"file_size":19374,
"width":253,
"height":320
},{
"file_id":"AgADBAACxxxx",
"file_size":75657,
"width":632,
"height":800
}]
这篇关于如何从电报中获取真实尺寸(而不是拇指)的照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文