Explorar o código

adjust jpeg compression quality to 0.15 for avatar uploads

Jan Kessler hai 4 meses
pai
achega
7f5dc22464
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/lib/components/chat/Settings/Account.svelte

+ 2 - 1
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;