Skip to content Skip to sidebar Skip to footer

Drawing Images To Canvas With Img.crossorigin = "anonymous" Doesn't Work

In a client-side standalone JS application, I'm trying to make it so I can call toDataURL() on a canvas on which I've drawn some images specified by a URL. Ie I can input into a te

Solution 1:

When the server requires authorization to access the images the value should be:

img.crossOrigin = "Use-Credentials";

Otherwise the browser will give up after receiving HTTP 401.

Post a Comment for "Drawing Images To Canvas With Img.crossorigin = "anonymous" Doesn't Work"