prithivMLmods commited on
Commit
04bbb7b
·
verified ·
1 Parent(s): 298ffc0

update app

Browse files
Files changed (1) hide show
  1. index.html +10 -1
index.html CHANGED
@@ -1351,8 +1351,17 @@
1351
  canvas.width = 64;
1352
  canvas.height = 64;
1353
  const ctx = canvas.getContext('2d');
1354
- ctx.fillStyle = '#ffffff'; // White bg for transparency safety
 
 
1355
  ctx.fillRect(0, 0, 64, 64);
 
 
 
 
 
 
 
1356
  ctx.drawImage(img, 0, 0, 64, 64);
1357
  avatarBase64 = canvas.toDataURL('image/jpeg', 0.95);
1358
 
 
1351
  canvas.width = 64;
1352
  canvas.height = 64;
1353
  const ctx = canvas.getContext('2d');
1354
+
1355
+ // Fill white background (corners will stay white)
1356
+ ctx.fillStyle = '#ffffff';
1357
  ctx.fillRect(0, 0, 64, 64);
1358
+
1359
+ // Apply circular clipping mask
1360
+ ctx.beginPath();
1361
+ ctx.arc(32, 32, 32, 0, Math.PI * 2, true);
1362
+ ctx.closePath();
1363
+ ctx.clip();
1364
+
1365
  ctx.drawImage(img, 0, 0, 64, 64);
1366
  avatarBase64 = canvas.toDataURL('image/jpeg', 0.95);
1367