Canvas tainted by cross-origin data

后端 未结 4 1704
南笙
南笙 2020-11-27 19:05

I\'m loading a motion jpeg from third-party site, which I can trust. I\'m trying to getImageData() but the browser (Chrome 23.0) complains that:



        
4条回答
  •  温柔的废话
    2020-11-27 19:33

    You cannot reset the crossOrigin flag once it is tainted, but if you know before hand what the image is you can convert it to a data url, see Drawing an image from a data URL to a canvas

    But no, you cannot and should not be using getImageData() from external sources that don't support CORS

提交回复
热议问题