javascript - Uncaught Error: SecurityError: DOM Exception 18 Canvas -
function getbase64image(img) { var canvas = document.createelement("canvas"); canvas.width = img.width; canvas.height = img.height; document.body.appendchild(canvas); var ctx = canvas.getcontext("2d"); ctx.drawimage(img, 0, 0); var dataurl = canvas.todataurl("image/png"); return dataurl; }
i seem violating something, can't seem find what. on how fix it?
if image drew canvas id domain canvas tainted , cannot produce data uri ftom it. copy image on same domain script prevent this.
Comments
Post a Comment