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

The canvas has been tainted by cross-origin data #195

Open
itsmnthn opened this issue Aug 14, 2020 · 1 comment
Open

The canvas has been tainted by cross-origin data #195

itsmnthn opened this issue Aug 14, 2020 · 1 comment

Comments

@itsmnthn
Copy link

Hello,

I am using color thief js locally and using remote image URL to find the color, I am getting this error Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data. I'm getting this error and then not getting colors obviously but I see images loaded on canvas and that is visible on the body.

Though I'm handling error in my code, ColorThief leaves the canvas on the body on an error. please make sure on the error you clear the DOM or memory used while finding color.

It would be better if you put a class or something to identify the canvas created by ColorThief. so it would be possible to tweak ColorThief canvas to hide on error or something.

@tuananhl
Copy link

+1

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

2 participants