emulate cameraRoll.getImage()

Hi,

is there any way of emulating this on the debuger ?

 cameraRoll.getImage().then(...)

or at least how do i create an image object from a local image?

To create a FuseJS style image from a valid file path, all you need is { path:'path/to/my/image.png' }
It’s a very uncomplicated object. If you really want to emulate FuseJS images you’ll need to add the name, width and height fields too but the path is all the FuseJS APIs really use.

Hi:

     ImageTools.getBase64FromImage({ path:'myFilePath.png' }).then(function(ImageBase){
     console.log("done!");
     });

does nothing… it does not crash either btw…

did i miss something?

thnx

try to add an error handler like:

     ImageTools.getBase64FromImage({ path:'myFilePath.png' }).then(function(ImageBase){
     console.log("done!");
     }, function(err){ console.log(err); });

or just .catch(func...

“Unsupported platform”

Is it not possible to getBase64FromImage on preview? (Mac)

Hi Zaulin…

Unfortunately these methods have only been implemented for Android and iOS. I have created an internal ticket for also supporting this on local preview.