android - 来自图库的精选照片在phonegap中以横向旋转

时间:2015-06-07 19:49:34

标签: javascript android cordova

我正在使用phonegap文件上传文件上传到服务器。当我从画廊中选择肖像照片时,它会旋转到风景

 function selectPicture() {
        navigator.camera.getPicture(
            function(uri) {
                var img = document.getElementById('camera_image');
                img.style.visibility = "visible";
                img.style.display = "block";
                img.src = uri;
                document.getElementById('camera_status').innerHTML = "Success";
            },
            function(e) {
                console.log("Error getting picture: " + e);
                document.getElementById('camera_status').innerHTML = "Error getting picture.";
            },
            { quality: 50, destinationType: navigator.camera.DestinationType.FILE_URI,correctOrientation : true, sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY});
    };

1 个答案:

答案 0 :(得分:0)

有一个" correctOrientation" getPicture(http://docs.phonegap.com/en/edge/cordova_camera_camera.md.html)的参数尝试将其设置为false(或true:D)

希望这有帮助