0

我目前正在使用科尔多瓦相机 getPicture,即使我已经说明了编码类型,它似乎也没有检索文件扩展名/类型。

navigator.camera.getPicture(onSuccess, onError, 
{   quality         : 50, 
    destinationType : navigator.camera.DestinationType.FILE_URI,
    sourceType      : navigator.camera.PictureSourceType.PHOTOLIBRARY,
    encodingType    : 0,
    mediaType       : 0
});

function onSuccess(imageURI) 
{
    $scope.uploadAttachment(imageURI);
}

function onError(message) 
{ 
    alert("fail");

    alert('Failed because: ' + message); 
} 
4

1 回答 1

1

您已经指定了返回图像文件的类型

eg.encodingType : 0

0 用于 JPEG,1 用于 PNG

于 2018-07-03T11:53:06.857 回答