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

CreateImage without CORS => tainted canvas #1

Open
forresto opened this issue May 24, 2014 · 1 comment
Open

CreateImage without CORS => tainted canvas #1

forresto opened this issue May 24, 2014 · 1 comment

Comments

@forresto
Copy link
Member

In the browser, image.crossOrigin = "Anonymous" needs to be set before the image is loaded. Otherwise, drawing the image to a canvas makes it impossible to get the pixels out of that canvas (context.drawImage works, but later getImageData won't).

You can't set it for all images, b/c non-CORS-served images will crash on load. I guess we could catch that and retry without crossOrigin. Or retry with our own CORS proxy.

This isn't an issue on Node.

@forresto
Copy link
Member Author

UrlToCanvas graph should be smart enough to cache / proxy non-CORS images.

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