Canvas2ImagePlugin icon indicating copy to clipboard operation
Canvas2ImagePlugin copied to clipboard

unable to save in IOS -- Security Error 18

Open arulapj opened this issue 9 years ago • 3 comments

Hi,

trying to use this plugin for ios, its working in android but not in ios, please note i am using phonegap build to compile ipa

code

index.html

script.js [code] function uploadImage(rul) { var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d");
var imageObj = new Image(); imageObj.src = rul; imageObj.onload = function () { try{ canvas.width = imageObj.width; canvas.height = imageObj.height; context.drawImage(imageObj, 0, 0); window.canvas2ImagePlugin.saveImageDataToLibrary( function(msg){ alert(JSON.stringify(msg)); }, function(err){ alert(JSON.stringify(err)); }, document.getElementById('myCanvas') ); }catch(e){alert("ERROR:"+JSON.stringify(e));} }; }
uploadImage("http://icdn.indiaglitz.com/hindi/gallery/Actress/PriyankaChopra/Priyanka_Chopra_8615_218.jpg");

[/code]

config.xml

<gap:plugin name="org.devgeeks.canvas2imageplugin" version="0.6.0" source="plugins.cordova.io" />

i am getting following error when excuted {"code":18,"name":"SecurityError", "message":"SecurityError: DOM Exception 18","line":22,"column":45,"sourceURL":"file:///private/var/mobile/Containers/Data..../www/plugins/../Canvas2ImagePlugin.js"}

the same thing worked for android

arulapj avatar Jun 08 '15 13:06 arulapj

+1 for this issue... any known workaround for this ????

EdwinRikkers avatar Jul 27 '15 13:07 EdwinRikkers

+1 having the same issue here. Is there a solution?

beaur avatar Feb 07 '16 23:02 beaur

Seems the issue only appears if using the WKWebView plugin. I've disabled that for now but hopefully there is a workaround.

beaur avatar Feb 08 '16 01:02 beaur