Save PNG Canvas Image to HTML5 Storage (JAVASCRIPT)?
I am developing a chrome extension. I open an image file in canvas, I apply some changes to it, then I am trying to save it to the HTML5 filesystem api. First I get the dataURL from the canvas: var dataURL = canvas.toDataURL('image/png;base64'); Then just the data: var image64 = dataURL.replace(/data:image\/png;base64,/, ''); Then I make a Blob. var bb = new BlobBuilder(); bb.append(image64); var blob = bb.getBlob('image/png'); Then I request the file system with the following function onInitFs(); function onInitFs(fs) { fs.root.getFile('image.png', {create: true}, function(fileEntry) { //