hi, i’m facing an issue with camera module , its crashing everytime i press ok (to choose the picture) when i takepicture
function takePicture(){
camera.takePicture().then(function(file){
photo.value = file;
Timer.create(function(){
encodeImage(file)
}, 300, false)
}).catch(function(reason){
console.log("loubou" + reason)
})
}
function encodeImage(image){
ImageTools.getBase64FromImage(image).then(function(ImageBase){
picture.value = ImageBase;
console.log("hey" + " " + JSON.stringify(ImageBase))
})
}
this is the javascript and below the ux
<Panel Height="100%" Alignment="Top" Row="0">
<WhileCount Items="{photo}" EqualTo="1">
<Image ux:Name="photo" File="assets/background/background.png" StretchMode="UniformToFill" >
<DataBinding Key="photo" Target="photo.File" />
<AddingAnimation>
<Change photo.Opacity="1" Duration="0.5" />
</AddingAnimation>
</Image>
</WhileCount>
<WhileEmpty Items="{photo}">
<Image ux:Name="backgroundImage" File="assets/background/background.png" StretchMode="UniformToFill">
<RemovingAnimation>
<Change backgroundImage.Opacity="0" Duration="0.5"/>
</RemovingAnimation>
</Image>
</WhileEmpty>
</Panel>
this is what my code looks like , anyone