I have a canvas composition that is made up of 10 different images. These images get data from an xml file that has a list of coordinates which creates a mask for each of the images as they are put onto the canvas.
I then try to save the canvas as an image with
var image = new Image();
image.src = canvas.toDataURL("image/png");
However, the image turns up completelty blank, and there are no errors. Upon inspecting the image that appears, the src is:
data:image/png;base64,iVBORw0KGgoAAAANS...ICxjqAABQ+0HCBAgQIBAWMQ4CcQAAAAAElFTkSuQmCC (shortened)
I read all about security issues, tainted canvas's etc when files are pulled from different domains but I don't get any errors and everything I use is hosted locally (http://localhost)
Any ideas on how to debug this?
EDIT: I'm more interested in just displaying this as an image in the browser, then worrying about saving it later. But if "saving" it to local storage then displaying it works, then i'm down with that.