Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用fromDataUrl添加一个图片后,在使用canvas.toBlob保存,存在跨域问题 #400

Open
zhang-hai opened this issue Dec 7, 2023 · 0 comments

Comments

@zhang-hai
Copy link

复现步骤:
1.调用fromDataUrl设置一个初始图片
2.采用canvas.toBlob()保存图片
报错信息:
Failed to execute 'toBlob' on 'HTMLCanvasElement': Tainted canvases may not be exported。

经查询后,跟跨域有关:https://blog.csdn.net/qiphon3650/article/details/80087987

跟踪源码后发现依赖的signature_pad的版本是3.0.0-beta.2,代码未设置image.crossOrigin = 'anonymous',个人也已在本地添加该行代码进行验证,完美保存!

请问是否可以更新下signature_pad的依赖版本,然后升级个版本?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant