diff --git a/src/windows/CameraProxy.js b/src/windows/CameraProxy.js index 505d3d8..64b6bb7 100644 --- a/src/windows/CameraProxy.js +++ b/src/windows/CameraProxy.js @@ -20,7 +20,7 @@ */ /*jshint unused:true, undef:true, browser:true */ -/*global Windows:true, URL:true, module:true, require:true */ +/*global Windows:true, URL:true, module:true, require:true, WinJS:true */ var Camera = require('./Camera'); @@ -701,25 +701,18 @@ function takePictureFromCameraWindows(successCallback, errorCallback, args) { var UIMaxRes = WMCapture.CameraCaptureUIMaxPhotoResolution; var totalPixels = targetWidth * targetHeight; - switch (true) { - case (totalPixels <= 320 * 240): - maxRes = UIMaxRes.verySmallQvga; - break; - case (totalPixels <= 640 * 480): - maxRes = UIMaxRes.smallVga; - break; - case (totalPixels <= 1024 * 768): - maxRes = UIMaxRes.mediumXga; - break; - case (totalPixels <= 3 * 1000 * 1000): - maxRes = UIMaxRes.large3M; - break; - case (totalPixels <= 5 * 1000 * 1000): - maxRes = UIMaxRes.veryLarge5M; - break; - default: - maxRes = UIMaxRes.highestAvailable; - break; + if (totalPixels <= 320 * 240) { + maxRes = UIMaxRes.verySmallQvga; + } else if (totalPixels <= 640 * 480) { + maxRes = UIMaxRes.smallVga; + } else if (totalPixels <= 1024 * 768) { + maxRes = UIMaxRes.mediumXga; + } else if (totalPixels <= 3 * 1000 * 1000) { + maxRes = UIMaxRes.large3M; + } else if (totalPixels <= 5 * 1000 * 1000) { + maxRes = UIMaxRes.veryLarge5M; + } else { + maxRes = UIMaxRes.highestAvailable; } cameraCaptureUI.photoSettings.maxResolution = maxRes;