mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 10:08:34 +00:00
fix: cross origin issue for image
This commit is contained in:
parent
20f1df47a3
commit
eec4e112b8
3 changed files with 6 additions and 3 deletions
|
|
@ -30,9 +30,11 @@
|
|||
"logLevel": "warning",
|
||||
"addToApiReportFile": true
|
||||
},
|
||||
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
},
|
||||
"ae-wrong-input-file-type": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-typescript": "^8.3.0",
|
||||
"@rollup/pluginutils": "^4.1.1",
|
||||
"@types/jest": "^26.0.23",
|
||||
"@types/jest": "^29.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.25.0",
|
||||
"@typescript-eslint/parser": "^4.25.0",
|
||||
"babel-jest": "^26.6.3",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ const { Image } = window;
|
|||
export function loadImage(src: string): Promise<HTMLImageElement> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const img = new Image;
|
||||
img.setAttribute('crossOrigin', 'anonymous');
|
||||
// img.setAttribute('crossOrigin', 'anonymous');
|
||||
img.crossOrigin = 'anonymous';
|
||||
img.onload = function() {
|
||||
resolve(img);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue