# Camera is crashing sometimes while retrieving the photo

**URL:** <https://forums.fusetools.com/t/camera-is-crashing-sometimes-while-retrieving-the-photo/5591>\
**Category:** Bug Reports\
**Created:** [September 22, 2016, 11:14am UTC](https://forums.fusetools.com/t/camera-is-crashing-sometimes-while-retrieving-the-photo/5591 "2016-09-22T11:14:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Kobo](https://avatars.discourse-cdn.com/v4/letter/_/f05b48/32.png) [@\_Kobo](https://forums.fusetools.com/u/_Kobo)\
**Post date:** [September 22, 2016, 11:14am UTC](https://forums.fusetools.com/t/camera-is-crashing-sometimes-while-retrieving-the-photo/5591/1 "2016-09-22T11:14:58Z")

</div>

Hi guys , i’m facing an issue using camera module , its sometimes crash when i press ok to retrieve a photo. this is what my code looks like:

```auto
	function takePicture(){
	  camera.takePicture(400,350).then(function(file)
	  {
	    picture.value = file
	  }).catch(function(e) {
	      console.log(e);
	  });
};

```

when press ok to retrieve the photo , if the photo is successfully retrieved , it takes sometimes to re enter the app however it crash immediately

---

<div class="post-metadata">

**Author:** ![Andreas\_Ronning](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/andreas_ronning/32/303_2.png) [@Andreas\_Ronning](https://forums.fusetools.com/u/Andreas_Ronning)\
**Post date:** [October 26, 2016, 5:38am UTC](https://forums.fusetools.com/t/camera-is-crashing-sometimes-while-retrieving-the-photo/5591/2 "2016-10-26T05:38:17Z")

</div>

This is from the old version of the API. The object you get is not a file, it’s an “image” object of image data. What you would want in your code is `picture.value = file.path`.
