From 999ce3425191542e25142570d9d52e97b66f8864 Mon Sep 17 00:00:00 2001 From: Aditya Gaurav Date: Fri, 6 Feb 2026 08:51:27 +0530 Subject: [PATCH] fix(web): avoid transparent pixels from rounded-full during profile picture capture (#25950) The cropContainer has rounded-full class which creates transparent corners when captured by domtoimage.toBlob(). Override border-radius and border to 0/none during capture to produce a clean square image. Co-authored-by: Aditya Gaurav --- web/src/lib/modals/ProfileImageCropperModal.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/lib/modals/ProfileImageCropperModal.svelte b/web/src/lib/modals/ProfileImageCropperModal.svelte index b252c53683..fc57964a6b 100644 --- a/web/src/lib/modals/ProfileImageCropperModal.svelte +++ b/web/src/lib/modals/ProfileImageCropperModal.svelte @@ -61,9 +61,14 @@ const containerSize = cropContainer.offsetWidth; // Capture the crop container which maintains 1:1 aspect ratio + // Override border-radius and border to avoid transparent corners from rounded-full const blob = await domtoimage.toBlob(cropContainer, { width: containerSize, height: containerSize, + style: { + borderRadius: '0', + border: 'none', + }, }); if (await hasTransparentPixels(blob)) {