1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    2
    Vote Rating
    0
    eleventy is on a distinguished road

      0  

    Default Unanswered: Ext.device.Camera quality setting error

    Unanswered: Ext.device.Camera quality setting error


    I'm trying to use the camera functions with Ext.device.Camera, using the new Sencha Packager ( not Phonegap)

    Code:
    Ext.device.Camera.capture(
                {
                    success: function(image) {
                        console.log(image.length);        
                        pdImage.setSrc("data:image/jpg;base64," + image);
                    },
                    source: 'camera',
                    width: 200,
                    height: 200,
                    destination: 'data'
                }
            );
    Everything is working, I can package ( using 'sencha app build native'), and run the app on the simulator and real Android device. A picture is taken, and displayed in my app.

    BUT: The width and height parameters have no effect: there's no difference between 'width: 20' and 'width: 2000', and, if I add a 'quality: 75' parameter, the app crashes with following error:

    Code:
    E/AndroidRuntime(  719): FATAL EXCEPTION: main
    E/AndroidRuntime(  719): java.lang.RuntimeException: Failure delivering result
     ResultInfo{who=null, request=1, result=-1, data=Intent { act=inline-data (has extras) }} to 
    activity {com.sj.test1/com.sj.test1.STActivity}:
     java.lang.IllegalArgumentException: quality must be 0..100
    If I build a similar app, using Phonegap and Eclipse, the quality and width/height settings work normally.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What ST2 version are you using?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    2
    Vote Rating
    0
    eleventy is on a distinguished road

      0  

    Default


    2.0.0 Final

    ( I just downloaded 2.0.1RC, but at the moment I'm getting an windows scripting error trying to run sencha on the command line: sencha.js, line 24 error:Object expected )

Thread Participants: 1