Telegram on iOS crashes when browsing stickers or gifs longer than 30 second
If you open the sticker/gif panel when entering a message, flip, twist, rotate, no matter how, but view them, 15-20 seconds - the application crashes. Steps to reproduce Entering a message; Click on the…
MozJPEG compression needs so much CPU time (45½ times, see https://libjpeg-turbo.org/About/Mozjpeg for details) that it is probably not affordable on Telegram servers or would require ridiculous amounts of Telegram's monetization. However, the collective ability of many hundred millions of client-side devices to shoulder (almost effortlessly) their individual parts of the cost of such better JPEG compression is quite obvious.
Telegram Desktop should also refrain from further client-side JPEG-to-JPEG recompression when its users save JPEG files. Any saved JPEG files should be saved exacty as they were received.
But I think it's a nice default to rescale and recompress images so they don't take much space.
Its changelog at https://github.com/telegramdesktop/tdesktop/releases/tag/v3.5.6 says “Always try to save original photo bytes to disk”.
Telegram Desktop no longer recompresses a JPEG file before sending if the following four rules are obeyed by that JPEG:
① JPEG format is progressive,
② JPEG's width is 1280 pixels or less,
③ JPEG's height is 1280 pixels or less,
④ JPEG's filesize is 4 bits (or less) per average pixel.
Such JPEG files are nevertheless recompressed (JPEG-to-JPEG), but only once (on the server side).