From 7f5dc22464d85742e3035025379cd408c0909329 Mon Sep 17 00:00:00 2001 From: Jan Kessler Date: Sun, 30 Mar 2025 14:14:14 +0200 Subject: [PATCH] adjust jpeg compression quality to 0.15 for avatar uploads --- src/lib/components/chat/Settings/Account.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Settings/Account.svelte b/src/lib/components/chat/Settings/Account.svelte index 6b3eba153..2e2c827cf 100644 --- a/src/lib/components/chat/Settings/Account.svelte +++ b/src/lib/components/chat/Settings/Account.svelte @@ -132,7 +132,8 @@ ctx.drawImage(img, offsetX, offsetY, newWidth, newHeight); // Get the base64 representation of the compressed image - const compressedSrc = canvas.toDataURL('image/jpeg'); + const jpegQuality = 0.15; + const compressedSrc = canvas.toDataURL('image/jpeg', jpegQuality); // Display the compressed image profileImageUrl = compressedSrc;