Cordova Camera getPicture from gallery not retrieving file extension

396 Views Asked by At

I am currently using the cordova camera getPicture and it doesn't seem to be retrieving the file extension/type even though I have stated the encoding type.

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); 
} 
1

There are 1 best solutions below

0
On

You have already specified the type of returning image file

eg.encodingType : 0

0 is for JPEG & 1 is for PNG