telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.88k stars 5.13k forks source link

invoice image is not displayed when enlarged, if width & height attributes are not set #27342

Open php4fan opened 8 months ago

php4fan commented 8 months ago

Steps to reproduce

  1. Have a bot send you an invoice where photo_url is the url of a PNG image (EDIT: see comment)
  2. click on the invoice thumbnail to see it enlarged

Expected behaviour

Either the image thumbnail should not be clickable in the first place if there was a good reason for it not being able to be enlarged (but that's not the case here), or, if it is clickable, should show the image in full size when clicked

Actual behaviour

When you click on the thumbnail, a partially transparent dark grey overlay covers the whole screen as if an image was going to be shown, but there's no image. The whole screen is being greyed out to show nothing. Note that this is never acceptable behavior. Even if there was a good reason for not being able to show the image, then you shouldn't grey out the screen and act as if you are showing an image: you should either not allow me to click it in the first place, or show some sort of error message (but here there's no reason for not showing the image properly).

If you click on the download icon to download the image, it will be saved with the .jpg extension, but it will still be saved as the original (which is a png), so the file extension won't match the actual image type. That gives me a clue of the possible cause of the bug: maybe you are assuming the image is a jpg, although nothing in the API documentation says it has to be.

Note that the mobile app behaves as expected, it shows the image full-screen when tapped.

Operating system

Manjaro Linux

Version of Telegram Desktop

4.12.2

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

php4fan commented 8 months ago

Actually I've just tried with a jpg and I'm getting the same issue.

I guess I'll have to create a bot for you to reproduce the issue.

Anyway:

php4fan commented 8 months ago

It seems to happen when the bot doesn't set the optional parameters photo_width and photo_height in the sendInvoice request.

github-actions[bot] commented 2 months ago

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

php4fan commented 2 months ago

Again the stupid bot

john-preston commented 1 month ago

@raphtlw Your screenshot is from another app, Telegram Swift. Maybe it's better to set the dimensions then 🤔