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

Error when I host it in server. Uncaught DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': Tainted canvases may not be loaded #30

Closed
veetechh opened this issue Aug 31, 2018 · 1 comment

Comments

@veetechh
Copy link

Uncaught DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': Tainted canvases may not be loaded

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@veetechh veetechh changed the title Error when I host it in serverUncaught DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': Tainted canvases may not be loaded Error when I host it in server. Uncaught DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': Tainted canvases may not be loaded Aug 31, 2018
@xavierjs
Copy link
Member

That's not a problem with facefilter, that's a problem with texture CORS. : Tainted canvases may not be loaded
you may use an image for a texture from another origin or protocol, so the canvas is tainted and some operation like GL.readpixel return this error.
It is explained here: https://webglfundamentals.org/webgl/lessons/webgl-cors-permission.html

You should either use a proxy for your image to use them from the good origin, or use 2 canvas: 1 not tainted for facefilter and 1 tainted with THREE.JS like in this example: https://github.com/jeeliz/jeelizFaceFilter/tree/master/demos/threejs/cube2cv

I close the issue because this is not a problem with facefilter

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