TelegramMessenger / Telegram-iOS

Telegram-iOS
6.34k stars 1.66k forks source link

Increase the photo size limit to 2560px. Telegram API is already allow to send photos with that size #943

Open Neurotoxin001 opened 1 year ago

Neurotoxin001 commented 1 year ago

Checklist

Description

For now Telegram for iOS is don't allow to send large images with 2560px size. But Telegram API already allows to send large images with 2560px. Also users can send 2560px images from Telegram Web K (Z is still don't support it).

Expected Behavior

Telegram API allows to send images as 2560px, so sending images of this size should be allowed

Actual Behavior

When images larger than 1280px are sent - they are compressed to 1280px

Steps to Reproduce

  1. Send image larger than 1280px
  2. Image will be downscaled to 1280px

Environment

Device: iPhone XR

iOS version: 16.2

App version: 9.2.1

ali-fareed commented 1 year ago

To the best of my knowledge, Telegram Desktop does not allow sending images larger than 1280x1280.

Neurotoxin001 commented 1 year ago

@ali-fareed I give link to commit https://github.com/telegramdesktop/tdesktop/commit/0f3ec7893d5f4f6ad4a2e3401551c95ce335740a It's will be released in next version soon.

ali-fareed commented 1 year ago

What do you think the referenced code does?

Neurotoxin001 commented 1 year ago

I seem to have misunderstood. But on the other hand, then why were these issues closed? https://github.com/telegramdesktop/tdesktop/issues/6520 https://github.com/telegramdesktop/tdesktop/issues/2206 And Telegram Web K sends images with 2560px.

Neurotoxin001 commented 1 year ago

Ok, I'm updated this issue and removed misunderstood TDesktop fix

Neurotoxin001 commented 1 year ago

Now it's official in TDesktop. But only in experemental settings: https://github.com/telegramdesktop/tdesktop/commit/84288112fc2a6dd16f9664f8fb5d9b97b78f4712 https://github.com/telegramdesktop/tdesktop/issues/6520#issuecomment-1368814249

ali-fareed commented 1 year ago

Ok, but it needs to be tested. A 2560x2560 image takes 4 times RAM to be stored (~26 MB).

Neurotoxin001 commented 1 year ago

At this moment you can't send 2560px images and can't see 2560px images on Telegram for iOS. When you see 2560px image in Telegram - it's downscaled like here https://github.com/telegramdesktop/tdesktop/issues/2206 but when you save it to your gallery - you can zoom it fine and see all details. And also when you send it as document on Telegram it's 2560px too.

ali-fareed commented 1 year ago

Correct.

Neurotoxin001 commented 1 year ago

Maybe you could do as in tdesktop, add an experimental setting in debug settings? To load (w/o needing to save it to gallery) and upload images larger than 1280px.