Closed omerasif57 closed 3 years ago
Photos has a lot of sizes for different screen resolutions. Sent photo is resized and comressed. If you want to send original photo as a file without changes, you must use sendDocument
for that.
Sent photo is resized and comressed.
Always? regardless of specifying high resolution fileid fileid = msg.photo[len(msg.photo)-1].file_id
PhotoSize array has every available resolution so what is the use case of having all those photo sizes?
you must use
sendDocument
for that.
Results in Type of file mismatch
error
_Sending by file_id: It is not possible to change the file type when resending by fileid. I.e. a video can't be sent as a photo, a photo can't be sent as a document, etc.
Sending by URL: In sendDocument, sending by URL will currently only work for gif, pdf and zip files.
So, I will have to make two separate calls for photo and document.
Always?
Always.
PhotoSize array has every available resolution so what is the use case of having all those photo sizes?
Photos has a lot of sizes for different screen resolutions.
So, I will have to make two separate calls for photo and document.
What exactly do you want to achieve? If you want to send a high-resolution photo without compression, you must send it as a document. You don't need to send it as a photo.
Right. I got it now. thanks.
Using telegram bot api in python, I am sending photo using a file.
bot.send_photo
First request:
Second and onwards ...
Here
fileid
represent the highest resolution file id available in PhotoSize array.Here is the
file id
: AgACAgQAAxkDAAIBMmAK636SiNEGCA8UILZ55gVppXfqAAIytjEbqp1RUJwNFOjmz7N6ZoHuJ10AAwEAAwIAA3cAAwRjBAABHgQProblem: I am receiving 1k resolution photo in bot chat. Please advise what I am missing here.