I'm trying to create some tool that saves text to images, now i've built something that works with a preview. But i've got one problem with the download, it keeps downloading a corrupt image...
I have tried a lot of things but nothing seems to work, my code for the download so far is:
download = document.getElementById('img-download');
download.addEventListener('click', prepareDownload, false);
function prepareDownload() {
var data = canvas.toDataURL();
download.href = data;
}
It is giving me 0 errors..
I have added a jsFiddle for better understanding: http://jsfiddle.net/4nehA/
EDIT: Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
is giving me the hard time..