hello community;
I’ve searched the forums some examples to encrypt a photo taken with the phone with getBase64FromImage(image) and desencritar with getImageFromBase64(base64). Without seeing a concrete response.
the problem I have; not display the decoded image on the interface.
Could someone help me I’m doing wrong?
Thank you.
the console shows me the following error:
D/dalvikvm(11508): GC_FOR_ALLOC freed 23239K, 77% free 7192K/30644K, paused 11ms, total 11ms
D/dalvikvm(11508): GC_FOR_ALLOC freed 1215K, 77% free 7191K/30644K, paused 11ms, total 11ms
E/BitmapFactory(11508): Unable to decode stream: java.io.FileNotFoundException: /iVBORw0KGg…
<App>
<JavaScript>
var Observable = require('FuseJS/Observable');
var camera = require("FuseJS/Camera");
var cameraRoll = require("FuseJS/CameraRoll");
var ImageTools = require('FuseJS/ImageTools');
var picture = Observable();
function Capture(){
camera.takePicture(400, 400).then(function(file){
encodeImage(file);
console.log("i'm here")
}).catch(function(reason){
console.log("error: " + reason)
})
}
function encodeImage(image){
ImageTools.getBase64FromImage(image).then(function(ImageBase){
console.log("encode ==> ",JSON.stringify(ImageBase))
decodeImage(ImageBase);
}).catch(function(reason){
console.log("error: " + reason)
})
}
function decodeImage(base64){
console.log("action decode Image");
ImageTools.getImageFromBase64(base64).then(function(ImageBase){
picture.value=ImageBase;
}).catch(function(reason){
console.log("error: " + reason)
})
}
module.exports = {
Capture:Capture,
picture:picture
}
</JavaScript>
<ClientPanel>
<Grid Rows="1*,1*">
<Grid Rows="1*">
<Grid Clicked="{Capture}">
<Text FontSize="12" Alignment="Center">Capture</Text>
</Grid>
</Grid>
<Grid Columns="1*">
<Grid>
<Image File="{picture}" Width="80%" Height="80%" Margin="30,0,0,0"/>
</Grid>
</Grid>
</Grid>
</ClientPanel>
</App>
Hi, sorry for the slow response.
I think this could be due to a bug that was fixed in 0.27.
Could you try this again with the latest Fuse release, and see if it’s working now?