mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 10:19:08 +00:00
Document potentially unexpected autoScale behavior
This commit is contained in:
@@ -108,6 +108,9 @@
|
|||||||
canvas.toDataURL('image/jpeg', quality)
|
canvas.toDataURL('image/jpeg', quality)
|
||||||
);
|
);
|
||||||
quality = quality * maxSize / blob.size;
|
quality = quality * maxSize / blob.size;
|
||||||
|
// NOTE: During testing with a large image, we observed the
|
||||||
|
// `quality` value being > 1. Should we clamp it to [0.5, 1.0]?
|
||||||
|
// See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob#Syntax
|
||||||
if (quality < 0.5) {
|
if (quality < 0.5) {
|
||||||
quality = 0.5;
|
quality = 0.5;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user