Merge pull request #12192 from Ithanil/avatar_compression

feat: adjust jpeg compression quality to 0.15 for avatar uploads
This commit is contained in:
Timothy Jaeryang Baek 2025-03-30 20:35:31 -07:00 committed by GitHub
commit 9c00f3caf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;