PDA

View Full Version : Ext.device.Camera.capture crashes the app on large images



sindoki
3 Sep 2012, 10:05 PM
Hello! Here is a problem...
I try to get a picture in my application. Here is the code:


Ext.device.Camera.capture({
source: 'album',
success: function (image) {
console.log("Success!");
var imageView = Ext.getCmp('imageEditField');
var imgSrc = "data:image/jpeg;base64," + image;
imageView.setSrc(imgSrc);
},
failure: function () {
console.log('failure', arguments);
},
config: {
quality: 75,
scope: this,
destination: 'data',
encoding: 'jpg',
height: "auto",
width: 90
}
}
);

This code invokes a file browser to pick a picture. And if I choose rather small picture, it works fine, but on a large one the application crashes. It's not related to the code of Success function, it fails before.
Is it a memory usage issue or something else? How can I fix it?
Will appreciate any advice. Thanks.

mitchellsimoens
5 Sep 2012, 10:30 AM
It still happens if you don't do anything in the success callback?

sindoki
6 Sep 2012, 2:48 AM
Yes, it does

gostbuster
6 Sep 2012, 4:06 AM
Is this happening on chrome too ? Or only on a smartphone ?

sindoki
6 Sep 2012, 10:16 PM
Obviously, it happens only on device.
On Chrome a photo is not really picked - the simulator gives a sample picture.

gostbuster
7 Sep 2012, 12:30 AM
Hum ..

Is it on an Android device ? did you test it on iPhone.

I experienced a same problem with application crashing when going to the device's camera interface.

I don't know if it will help you, but It was an application with phonegap. That application crashed when I was trying to take a picture. It was an Android (version 4.xx....) device. (worked fine with android 2.xx and iPhone)

I solved my problem updating phoneGap.

Hope it helps...

sindoki
11 Sep 2012, 12:46 PM
Yes, it's on Android but without PhoneGap. I'm still searching for the solution.

alexjfalcao
2 Oct 2012, 5:42 PM
Hi Sendoki, did you found a solution? I'm experiencing the same issue. Thanks

gostbuster
2 Oct 2012, 11:28 PM
Hi, what do you use to get an android installed application ?

alexjfalcao
3 Oct 2012, 6:44 AM
Hi,

I'm using Eclipse, and Sencha SDK on MAC. The Android API 7 and 15. I've tried to install on Galaxy SII with android 4.0.3.

Thanks

sindoki
3 Oct 2012, 11:35 PM
Yes, I'm still having this issue. I think, I'll try to use PhoneGap. Maybe it will work better.

alexjfalcao
4 Oct 2012, 6:22 AM
Thanks Sindoki...
I'm also giving up sencha on this case.
Do you have any good tutorial or example of PhoneGap with Sencha for this purpose?
Thanks in advance