I am trying to set up CORS enabled canvas.toDataURL(); for a paperjs element it is not working ?

7,970 views
Skip to first unread message

nick hulea

unread,
Feb 25, 2014, 2:52:44 PM2/25/14
to pap...@googlegroups.com
Hi I am trying to implement creating an image using canvas.toDataURL(); demo here - > http://jsfiddle.net/naeluh/a87rC/

Go ahead and click the button top left ?

I get this in the console - > Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

I am aware of the headers and attributes that need to be set and thought I did but alas no luck ?

Please if anyone out there has a tip Id like it cause I am stumped ?

thanks

Jürg Lehni

unread,
Feb 25, 2014, 4:46:41 PM2/25/14
to pap...@googlegroups.com
That issue is browser related, and not really about paper.js. I don't think this is the right place to ask this question.

--
You received this message because you are subscribed to the Google Groups "Paper.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to paperjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

nick hulea

unread,
Feb 25, 2014, 5:14:57 PM2/25/14
to paperjs
Hi Jurg, 

Ok I just haven't found an example of paper.js returning a data image with cross origin images so I wasnt sure where to turn I have had it working with images that are NOT cross origin but I just wanted to know if paperjs actually supported this type of todataurl with cross orgins I am assuming it does ? Is that correct ? Its just since I have not seen an example of it happening doesn't mean it does not work. 

Ok I guess I will keep trying. 

thanks 

Nick
--
Nick Hulea the third
http://www.hulea.org
ph:330-207-3406

nick hulea

unread,
Feb 27, 2014, 1:50:12 PM2/27/14
to paperjs
Jurg, 

I just thought Id past this along that it is not possible without creating all data images for corresponding urls to achieve cross orgin support for canvas.toDataURL();

This runs pretty slow  but it makes it possible http://jsfiddle.net/naeluh/JQ2dB/

convertImages(); does just what it says converts the images to base64 data pngs

For this demo to work one would need to add var clientId = 'your imgur api key here'; on line 43 

thanks

Nick
Reply all
Reply to author
Forward
0 new messages