2

I am using the Phonegap plugin Canvas2Image: https://github.com/devgeeks/Canvas2ImagePlugin and I was wondering if it would be possible to get the rendered image in the callback?

I am using the code out of their documentation:

window.canvas2ImagePlugin.saveImageDataToLibrary(
        function(msg){
            console.log(msg);
        },
        function(err){
            console.log(err);
        },
        document.getElementById('myCanvas')
    );

This works great to save to the library as intended, but if I want to use the actual photo.png or whatever is generated, can I do this? If not, is there a way in the callback to get the local filesystem URL to the image?

Arun
  • 626
  • 10
  • 29

1 Answers1

0

The first function, with msg in the parameter, is going to be your file URL. However, it only is calling back on android. IOS is not working at this time. On the github site, there is an open issue on the matter. I haven't verified it, but someone said that iPhone: How do I get the file path of an image saved with UIImageWriteToSavedPhotosAlbum()? helps to fix the issue.

Github issue: https://github.com/devgeeks/Canvas2ImagePlugin/issues/38

Community
  • 1
  • 1
wbt11a
  • 798
  • 4
  • 12
  • Heres a forked plugin that will return the local filesystem url for iOS: https://github.com/wbt11a/Canvas2ImagePlugin or Adobe Build: https://build.phonegap.com/plugins/968 – wbt11a Oct 15 '14 at 18:16