telegramdesktop / tdesktop

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

Received photos are smaller than in Telegram Web #2206

Closed wodim closed 1 year ago

wodim commented 8 years ago

I have a bot that sends photos to users. Those photos are sent as regular photos, not files.

The photos have a resolution of 1600x1200. Telegram Web shows the photos at the original size, but Telegram Desktop receives them at a resolution of 1280x960, with a very very ugly rescaling method.

ghost commented 7 years ago

Hey there!

We're automatically closing this issue since there was no activity in this issue since 361 days ago. We therefore assume that the user has lost interest or resolved the problem on their own. Closed issues that remain inactive for a long period may get automatically locked.

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

Thanks!

(Please note that this is an automated comment.)

stek29 commented 7 years ago

@auchri I guess it should be reopened, if @wodim tried to recreate the issue.

r0mko commented 6 years ago

Should be reopened. Photo quality in Telegram Desktop is worse than in Telegram for macOS. Photos are sent in size 1920, but are downsized on the client side.

wodim commented 6 years ago

I understand the importance of having a clean bug tracker but closing issues automatically is a mistake. This bug still exists

stek29 commented 6 years ago

@r0mko Telegram Web issues should not be reported here

@wodim could you provide an example? Maybe you can make a channel and forward a message causing this issue into it?

r0mko commented 6 years ago

@stek29 I've mistaken. In fact I meant Telegram Desktop. Telegram Web does not suffer from this issue.

r0mko commented 6 years ago

@stek29 I can provide photo examples

wodim commented 6 years ago

https://t.me/resiz

Look at the picture from Telegram Web and then Telegram Desktop. Focus on the text.

auchri commented 6 years ago

If I download the picture, it has a dimension of 1280x960 (both Telegram Desktop and Telegram Web).

wodim commented 6 years ago

Right click and then "View Image".

image

r0mko commented 6 years ago

@auchri Telegram Web photo quality depends on your screen resoltion. On a 4K diaplay it opens in 1600x1200

auchri commented 6 years ago

Fun fact: If I download the picture using the Android-App, it also has a dimension of 1280x960.

wodim commented 6 years ago

On my mobile it also looks fine, with no artifacts from resizing.

On Sun, Dec 3, 2017 at 1:49 PM, r0mko notifications@github.com wrote:

@auchri https://github.com/auchri Telegram Web photo quality depends on your screen resoltion. On a 4K diaplay it opens in 1600x1200

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/2206#issuecomment-348764055, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9IUbCGw3F44aRJrX62cQhJjgMYlopwks5s8pjMgaJpZM4JCsXk .

wodim commented 6 years ago

I don't care that much about the resolution, but this is awful.

image

r0mko commented 6 years ago

@auchri this is also a known issue of the Android App. iOS app renders files in largest available resolution

r0mko commented 6 years ago

@wodim @auchri compare this https://t.me/tg_photo_quality_test

r0mko commented 6 years ago

Telegram Desktop: image Telegram Web/Telegram for macOS: image The difference is obvious

john-preston commented 6 years ago

@r0mko Yes, looks like web version uses larger images :( tdesktop uses single image size for displaying the photo in the message history and in the photo viewer, and it is not the maximum available size, so that message history would load fast enough.

enchained commented 6 years ago

@john-preston But why same images look much worse when you open them in photo viewer from a bot/channel in tdesktop? In comparison to when you open in chat with a person or yourself. The image size is the same for me in both cases (1280x960).

Steps to reproduce:

  1. Join https://t.me/resiz, compare the text in image visually from Telegram Desktop vs Telegram Web (or iOS). The text looks very uneven on edges. Forward this channel's message with the image to yourself.
  2. Download that image from the place where it looks better, like Telegram Web.
  3. Send that image to yourself (with compression)
  4. In your Saved messages, compare the images side by side clicking on viewer arrows, look at the text. It's very different. Wouldn't the pictures look pretty much the same at this point, if it was just the global "single image size" that caused the problem?

Why Telegram Desktop renders images from bots/channels vs chats differently? It looks like some REALLY bad scaling takes place at some point. Does the image viewer differentiate between sender types somehow? What could be the variables that viewer's image rendering depending on?

It is a big issue for me, cause I send a lot of screenshots via the bot from my tv when I watch movies with subtitles.

john-preston commented 6 years ago

@enchained If after sending to saved messages you clear local storage in Settings and relaunch the app - will it still be better in Saved messages.

enchained commented 6 years ago

@john-preston After clearing and relaunching the Telegram Desktop - nothing changed - the image that was sent by myself is still looking much better than the image that was forwarded from the channel.

enchained commented 6 years ago

Noticed that, in addition to when sent via the bot API, it's reproducible by simply clicking on the preview of any image url send by any person to any chat. Looks like it uses the same compression algorithm or something. The bug is most noticeable on pictures with thin lines - lineart, anime screenshots, subtitles with an outline.

So the easiest way to reproduce follows:

  1. Find the image with thin lines over the internet
  2. Copy it's url
  3. Save the image
  4. Send the url manually to a chat
  5. Send the image (as image) manually to a chat
  6. Compare the two
  7. Compare that to any other client
  8. Bug is still there after cache reset and restart.
soredake commented 6 years ago

@john-preston

john-preston commented 6 years ago

@soredake There is some tradeoffs. Currently I load not the largest image of all available to show them in the chat. After that images are instantly opened in the mediaviewer if you click on them. If we decide to load the largest one in mediaviewer it will first download an image for the chat, and after click will load even more. Another option is to load the largest image for the chat in the first place, but this will work slower.

stek29 commented 6 years ago

@john-preston what about showing worse photo in media viewer at first, and then replacing it with better image?

john-preston commented 6 years ago

@stek29 Size of the image in the mediaviewer is taken from the real image size. If we use size of a large image and show a small image there it will be pixelated or blurred — so we need to show loading progress (so user knows that this is not a final image, this can take some time in case of a large image)..

kirsan31 commented 6 years ago
off-topic question Guys, it's off-topic here, and not Tdesktop problem, but related issue, and I dunno where else to ask... About a month ago telegram server begun to drastically reduce gifs! You sending a big one, but opponent received a small copy, like a preview. We tried tdesktop, android and web clients - all the same. Any one know what happening? Google cant answer this question. Once again sorry for offtop.
Kagami commented 6 years ago

Just encountered (hopefully) same issue with latest Telegram Desktop on Linux (1.3.14).

As you can see Linux version looks much worse, probably due to nearest neighbor resampling filter being used. Is it possible to use better filter like Lanczos or at least Catmull-Rom?

Termuellinator commented 5 years ago

i just encountered an issue where a sent image is resized to a 1280-resolution - for me it is resized in desktop, web and android-client. I'm generally no fan of resizing - i don't care if it takes longer to load, but often times a resized image is basically useless (so i'd rather wait then have something useless quickly ;) ) If speed is a big concern for others, maybe a button "load original" or something would be a compromise?

john-preston commented 5 years ago

@Termuellinator You always can send original file by sending the image as a file, not s photo.

Termuellinator commented 5 years ago

@john-preston sure, that's a workaround - but it would be much more convenient to just be able to properly view images above 1280 resolution within the client instead of downloading, browsing to the folder with the file manager and opening the image ;) This is especially true since ctrl+mousewheel works for zooming in telegram-desktop (but is not really that useful for low-res images) :)

ImoutoChan commented 5 years ago

@john-preston What do you think about option that would enable largest possible image downloads? We can switch it off by default.

Also, at least tdesktop should download the best available quality when user saves images manually.

stale[bot] commented 3 years ago

Hey there!

This issue will be automatically closed in 7 days if there would be no 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!

Termuellinator commented 3 years ago

still very much an issue

stale[bot] commented 3 years 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!

Termuellinator commented 3 years ago

Unfortunately i have to post the same as last time: still an issue

stale[bot] commented 2 years 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!

Remu-rin commented 2 years ago

Not resolved.

stale[bot] commented 2 years 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!

Remu-rin commented 2 years ago

Not resolved.

conor888 commented 2 years ago

This is still very much an issue--I actually had no idea this was a client-side problem and not Telegram in general, as I've been using Telegram Desktop since 2014.

Neurotoxin001 commented 1 year ago

We still need it…

Lesiuk commented 1 year ago

TDesktop is resizing those images just after downloading them. PhotoMedia::set is responsible for it. Android, iOS, MacOSX clients are displaying 2560px images as 2560px images. Not downscaling them client side.

https://github.com/telegramdesktop/tdesktop/pull/25584

mrogin-technic commented 1 year ago

6520 was closed, but the topic was sending photos with more than 1280px. Is there finally a way to send photos (not files) with a better quality?