Camera crash everytime

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

I think this should work but question why did you use the Timer module here?

But its not working , the app crash everytime Timer was just for testing no worry about it. so maybe an issue with my phone so?

Try adding a catch to this part:

function encodeImage(image){
  ImageTools.getBase64FromImage(image).then(function(ImageBase){
    picture.value = ImageBase;
    console.log("hey" + " " + JSON.stringify(ImageBase))
  })
}

and see what error is passed by logging it, and by the way what version are you on?

nothing to do with the encodeImage function , its somehting with the first function i think , because the process end at the moment when i take the picture. the app doesnt have the time to encode something, and i dont have any error in the console

After few test with other phones i can say that this is not a problem with fuse , but the phone itself , regarding the phone you are using a fuse app , some modules will fully work or not. Maybe some lowcost or middle cost phone will encounter this type of issue. my phone where the module crash is LG G4 Stylus, i’m using the last fuse version

regards

Thanks Prince. We will try to get hold of a device like that and see if we can reproduce.