Github user muratsu commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/94#discussion_r30262317 --- Diff: src/windows/CameraProxy.js --- @@ -438,6 +457,61 @@ function takePictureFromCameraWP(successCallback, errorCallback, args) { }); }; + var getAspectRatios = function (capture) { + var photoAspectRatios = capture.videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.photo).map(function (element) { + return (element.width / element.height).toFixed(1); + }).filter(function (element, index, array) { if (index === array.indexOf(element)) return 1; return 0; }); + + var videoAspectRatios = capture.videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.videoRecord).map(function (element) { + return (element.width / element.height).toFixed(1); + }).filter(function (element, index, array) { if (index === array.indexOf(element)) return 1; return 0; }); + + var videoPreviewAspectRatios = capture.videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.videoPreview).map(function (element) { + return (element.width / element.height).toFixed(1); + }).filter(function (element, index, array) { if (index === array.indexOf(element)) return 1; return 0; }); + + var allAspectRatios = [].concat(photoAspectRatios, videoAspectRatios, videoPreviewAspectRatios); + + var aspectObj = allAspectRatios.reduce(function (map, item) { + if (!map[item]) { + map[item] = 0; + } + map[item]++; + return map; + }, {}); + + return Object.keys(aspectObj).filter(function (k) { + return aspectObj[k] === 3; --- End diff -- this is by design. all of the capture modes should be set to the same ratio otherwise there are artifacts on the captured image. this is a platform limitation.
--- 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