Преглед на файлове

adjust jpeg compression quality to 0.15 for avatar uploads

Jan Kessler преди 4 месеца
родител
ревизия
7f5dc22464
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  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;