Github user muratsu commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/96#discussion_r30757436 --- Diff: src/windows/CameraProxy.js --- @@ -546,20 +575,31 @@ function takePictureFromCameraWindows(successCallback, errorCallback, args) { } // decide which max pixels should be supported by targetWidth or targetHeight. - if (targetWidth >= 1280 || targetHeight >= 960) { - cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.large3M; - } else if (targetWidth >= 1024 || targetHeight >= 768) { - cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga; - } else if (targetWidth >= 800 || targetHeight >= 600) { - cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.mediumXga; - } else if (targetWidth >= 640 || targetHeight >= 480) { - cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.smallVga; - } else if (targetWidth >= 320 || targetHeight >= 240) { - cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.verySmallQvga; - } else { - cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.highestAvailable; + var maxRes = null; + var UIMaxRes = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution; + switch (true) { + case (targetWidth >= 1280 || targetHeight >= 960) : + cameraCaptureUI.photoSettings.maxResolution = UIMaxRes.large3M; + break; + case (targetWidth >= 1024 || targetHeight >= 768) : + maxRes = UIMaxRes.mediumXga; + break; + case (targetWidth >= 800 || targetHeight >= 600) : + maxRes = UIMaxRes.mediumXga; + break; + case (targetWidth >= 640 || targetHeight >= 480) : + maxRes = UIMaxRes.smallVga; + break; + case (targetWidth >= 320 || targetHeight >= 240) : + maxRes = UIMaxRes.verySmallQvga; + break; + default : + maxRes = UIMaxRes.highestAvailable; } + cameraCaptureUI.photoSettings.maxResolution = maxRes; + + --- End diff -- nitpick: extra line
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org