drewdaemon / drewdaemon/angular-image-annotator

ERROR DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

未关闭
#17 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
3
派生
16
PR 合并指标
30 天内没有已合并 PR

描述

I used the following tag to load the image:

```

```

I used the following function in my component to save the return Url from `getAnnotatedImage()` function call:

```
save() {
let saved = this.annotator.getAnnotatedImage('image/png');
if (saved)
this.mySavedImage = saved;
}
```
but it failed with the following error:

```
ERROR DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
at AiaImageAnnotatorComponent.getAnnotatedImage (http://localhost:4200/vendor.js:71813:28)
at AppComponent.save (http://localhost:4200/main.js:168:36)
at AppComponent_Template_button_click_171_listener (http://localhost:4200/main.js:493:147)
at executeListenerWithErrorHandling (http://localhost:4200/vendor.js:26822:16)
at wrapListenerIn_markDirtyAndPreventDefault (http://localhost:4200/vendor.js:26864:22)
at HTMLButtonElement. (http://localhost:4200/vendor.js:60166:38)
at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:412:35)
at Object.onInvokeTask (http://localhost:4200/vendor.js:44161:33)
at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:411:40)
at Zone.runTask (http://localhost:4200/polyfills.js:180:51)
```

I tried to save when it has not been edited, it failed the same way. Is the save function implemented in this tool?

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先复现 AppComponent.save(),该方法会调用 AiaImageAnnotatorComponent.getAnnotatedImage('image/png'),并检查与该入口点关联的 canvas 导出路径。确定未编辑图像的预期行为,以及库是否处理了报告的失败;当预期的保存行为已经确定并验证后,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。