cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-9443) Windows camera picks incorrect maxResolution
Date Mon, 03 Aug 2015 21:00:05 GMT

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

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

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

    https://github.com/apache/cordova-plugin-camera/pull/111#discussion_r36130954
  
    --- Diff: src/windows/CameraProxy.js ---
    @@ -696,21 +696,22 @@ function takePictureFromCameraWindows(successCallback, errorCallback,
args) {
         // decide which max pixels should be supported by targetWidth or targetHeight.
         var maxRes = null;
         var UIMaxRes = WMCapture.CameraCaptureUIMaxPhotoResolution;
    +    var totalPixels = targetWidth * targetHeight;
         switch (true) {
    -        case (targetWidth >= 1280 || targetHeight >= 960) :
    -            cameraCaptureUI.photoSettings.maxResolution = UIMaxRes.large3M;
    +        case (totalPixels <= 320 * 240):
    +            cameraCaptureUI.photoSettings.maxResolution = UIMaxRes.verySmallQvga;
                 break;
    -        case (targetWidth >= 1024 || targetHeight >= 768) :
    -            maxRes = UIMaxRes.mediumXga;
    +        case (totalPixels <= 640 * 480):
    +            maxRes = UIMaxRes.smallVga;
                 break;
    -        case    (targetWidth >= 800 || targetHeight >= 600) :
    +        case (totalPixels <= 1024 * 768):
                 maxRes = UIMaxRes.mediumXga;
                 break;
    -        case  (targetWidth >= 640 || targetHeight >= 480) :
    -            maxRes = UIMaxRes.smallVga;
    +        case (totalPixels <= 3 * 1000 * 1000):
    +            maxRes = UIMaxRes.large3M;
                 break;
    -        case    (targetWidth >= 320 || targetHeight >= 240) :
    -            maxRes = UIMaxRes.verySmallQvga;
    +        case (totalPixels <= 5 * 1000 * 1000):
    +            maxRes = UIMaxRes.veryLarge5M;
                 break;
             default :
                 maxRes = UIMaxRes.highestAvailable;
    --- End diff --
    
    switch(true) is faster, + Personally, I find it easier to read.


> Windows camera picks incorrect maxResolution
> --------------------------------------------
>
>                 Key: CB-9443
>                 URL: https://issues.apache.org/jira/browse/CB-9443
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Camera
>         Environment: Windows Desktop, Windows Phone 10
>            Reporter: Murat Sutunc
>            Assignee: Murat Sutunc
>              Labels: Windows
>




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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message