feat: Don't scale down huge non-JPEGs, recode them first (#7977)#7992
Open
feat: Don't scale down huge non-JPEGs, recode them first (#7977)#7992
Conversation
cbe06c0 to
13efe75
Compare
iequidoo
commented
Mar 15, 2026
| let (pre_message, _, _) = send_large_image_message(alice, a_group_id).await?; | ||
| let msg = bob.recv_msg(&pre_message).await; | ||
| assert_eq!(msg.text, "test".to_owned()); | ||
| assert_eq!(msg.get_text(), "test [Image – 146.12 KiB]".to_owned()); |
Collaborator
Author
There was a problem hiding this comment.
It's annoying to fix this number every time we change image encoding, even JPEG quality can't be changed
e5194f3 to
1208117
Compare
If after recoding to JPEG an image isn't huge anymore, don't scale it down, this preserves quality of most screenshots. For JPEGs however we don't try to recode them w/o scaling down: - They are already JPEG-encoded, maybe with higher quality, but anyway. - We don't want extra CPU work for most photos.
1208117 to
c780392
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If after recoding to JPEG an image isn't huge anymore, don't scale it down, this preserves quality of most screenshots. For JPEGs however we don't try to recode them w/o scaling down:
Close #7977