From 8e29711e498d9e99f1821d48ca11ed53ea6359e3 Mon Sep 17 00:00:00 2001 From: lidongtony Date: Mon, 5 Sep 2022 16:00:26 +0000 Subject: [PATCH] =?UTF-8?q?update=20index.js.=E4=BF=AE=E5=A4=8Dweb?= =?UTF-8?q?=E7=AB=AFcanvas=E8=B7=A8=E5=9F=9F=E6=8A=A5=E9=94=99,=E5=AF=BC?= =?UTF-8?q?=E8=87=B4qsc.toImage()=E6=89=A7=E8=A1=8C=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20=E9=9D=9E=E5=B8=B8=E9=87=8D=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=8C=E5=B8=8C=E6=9C=9B=E4=BD=9C=E8=80=85?= =?UTF-8?q?=E5=90=88=E5=B9=B6~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lidongtony --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index a42b273..de17ed2 100644 --- a/index.js +++ b/index.js @@ -981,6 +981,7 @@ } // node 也可以用这种方式 const imgObj = new Image() + imgObj.crossOrigin = 'anonymous' imgObj.onload = () => { rs(imgObj) } @@ -1334,6 +1335,7 @@ var canvas = document.createElement('canvas') var c2x = canvas.getContext('2d') var img = new Image + img.crossOrigin = 'anonymous' img.onload = function() { canvas.width = img.width canvas.height = img.height -- Gitee