[ 
https://issues.apache.org/jira/browse/CB-8804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594164#comment-14594164
 ] 

ASF GitHub Bot commented on CB-8804:
------------------------------------

Github user dpolivy commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-camera/pull/97#discussion_r32879268
  
    --- Diff: src/android/CameraLauncher.java ---
    @@ -173,6 +181,20 @@ else if ((srcType == PHOTOLIBRARY) || (srcType == 
SAVEDPHOTOALBUM)) {
         // LOCAL METHODS
         
//--------------------------------------------------------------------------
     
    +    private void processConfiguration(JSONArray args) throws JSONException 
{
    +        if (args == null)
    +            throw new JSONException("no configuration object passed");
    +        this.mQuality = args.optInt(0, 80);
    +        // args 1 and 2 (destType, srcType) are skipped because they have 
no field representation in this class
    +        this.targetWidth = args.optInt(3);
    +        this.targetHeight = args.optInt(4);
    +        this.encodingType = args.optInt(5, JPEG);
    +        this.mediaType = args.optInt(6, PICTURE);
    +        this.allowEdit = args.optBoolean(7);
    +        this.correctOrientation = args.optBoolean(8);
    +        this.saveToPhotoAlbum = args.optBoolean(9);
    +    }
    --- End diff --
    
    Nice! FWIW, I added in defaults for all values. Here's my edit:
    
            this.mQuality = args.optInt(0, 80);
            // args 1 and 2 (destType, srcType) are skipped because they have 
no field representation in this class
            this.targetWidth = args.optInt(3, 0);
            this.targetHeight = args.optInt(4, 0);
            this.encodingType = args.optInt(5, JPEG);
            this.mediaType = args.optInt(6, PICTURE);
            this.allowEdit = args.optBoolean(7, false);
            this.correctOrientation = args.optBoolean(8, false);
            this.saveToPhotoAlbum = args.optBoolean(9, false);


> https://github.com/apache/cordova-plugin-camera#android-quirks
> --------------------------------------------------------------
>
>                 Key: CB-8804
>                 URL: https://issues.apache.org/jira/browse/CB-8804
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Plugin Camera
>         Environment: Android
>            Reporter: Serge Huijben
>
> Android Quirks
> Android uses intents to launch the camera activity on the device to capture 
> images, and on phones with low memory, the Cordova activity may be killed. In 
> this scenario, the image may not appear when the Cordova activity is restored.
> It can be solved bij implementing this PR: 
> https://github.com/apache/cordova-plugin-camera/pull/97



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to