Spaces:
Running
Running
Update index.html
Browse files- 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 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 ─────────────────────────────────────────────────────
|