Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3768x3768 JPEG image (553 kB) got downscaled to 3072x3072 in high-quality mode #6893

Closed
2 tasks done
EwoutH opened this issue May 30, 2024 · 4 comments
Closed
2 tasks done

Comments

@EwoutH
Copy link
Contributor

EwoutH commented May 30, 2024

Using a supported version?

  • I have searched searched open and closed issues for duplicates.
  • I am using Signal-Desktop as provided by the Signal team, not a 3rd-party package.

Overall summary

A 3768x3768 JPEG image of 553 kB got downsized to 3072x3072 in high-quality mode.

If I read this logic correctly, that shouldn't be the case, as long as it's under 4096 by 4096 and under 3 MB.

const MEDIA_QUALITY_LEVEL_DATA = new Map([
[MediaQualityLevels.One, DEFAULT_LEVEL_DATA],
[
MediaQualityLevels.Two,
{
maxDimensions: 2048,
quality: 0.75,
size: MiB * 1.5,
thresholdSize: 0.3 * MiB,
},
],
[
MediaQualityLevels.Three,
{
maxDimensions: 4096,
quality: 0.75,
size: MiB * 3,
thresholdSize: 0.4 * MiB,
},
],
]);
const SCALABLE_DIMENSIONS = [3072, 2048, 1600, 1024, 768];
const MIN_DIMENSIONS = 512;

I would expect that I. WhatsApp high quality even allows images of ~5400 pixels wide to be shared in high quality mode.

(can't share the image unfortunately).

Steps to reproduce

  1. Send a JPEG image under 1MB
  2. Observe compression

Expected result

Full quality image

Actual result

Compressed image

Screenshots

No response

Signal version

7.11.0

Operating system

Windows 11

Version of Signal on your phone

No response

Link to debug log

No response

@EwoutH
Copy link
Contributor Author

EwoutH commented May 30, 2024

Or does the thresholdSize: 0.4 * MiB part mean that everything under 0.4 MiB (~419 kB) will be downsided? Because that's very low for a high-definition image.

@scottnonnenberg-signal
Copy link
Contributor

Yes, resizing logic does take effect when the overall size of the original message is over threshholdSize.

The numbers are as they are to give global and primarily mobile Signal users a good experience. Images can be very large, and global data plans are often limited.

@EwoutH
Copy link
Contributor Author

EwoutH commented Jun 22, 2024

Where could we further discuss these numbers/tiers?

@scottnonnenberg-signal
Copy link
Contributor

The forums are the best place to talk through the details of designs, desired features: https://community.signalusers.org/c/beta-feedback/25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants