P粉4656759622023-08-30 09:13:14
As others have said, you are "polluting" the canvas by loading from a cross-origin domain.
https://developer.mozilla.org/en-US/docs/ HTML/CORS_Enabled_Image
However, you can prevent this by simply setting:
img.crossOrigin = "Anonymous";
This only works if the remote server correctly sets the following headers:
Access-Control-Allow-Origin "*"
Dropbox file picker when using the Direct Link optionThis is a good example. I'm using this at oddprints.com to suck images from a remote dropbox image URL into my canvas and then submit the image data back to my server. All written in JavaScript