mr4 commited on
Commit
2f7dc43
·
verified ·
1 Parent(s): c4aa48d

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +9 -5
index.html CHANGED
@@ -659,11 +659,15 @@
659
  drawW = Math.round(drawW * ratio);
660
  drawH = Math.round(drawH * ratio);
661
  }
662
- canvas.width = drawW;
663
- canvas.height = drawH;
664
- canvas.getContext('2d').drawImage(img, 0, 0, drawW, drawH);
665
- };
666
- img.src = 'hikari.jpg';
 
 
 
 
667
  });
668
 
669
  // ── ImagePreprocessor ─────────────────────────────────────────────────────
 
659
  drawW = Math.round(drawW * ratio);
660
  drawH = Math.round(drawH * ratio);
661
  }
662
+ canvas.width = drawW;
663
+ canvas.height = drawH;
664
+ canvas.getContext('2d').drawImage(img, 0, 0, drawW, drawH);
665
+ URL.revokeObjectURL(blobUrl);
666
+ };
667
+ img.src = blobUrl;
668
+ } catch (err) {
669
+ setStatus('error', `Không thể tải ảnh mẫu: ${err.message}`);
670
+ }
671
  });
672
 
673
  // ── ImagePreprocessor ─────────────────────────────────────────────────────