J.Do
J.Do

Reputation: 301

Cordova Camera getPicture from gallery not retrieving file extension

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

Upvotes: 0

Views: 392

Answers (1)

Maheshvirus
Maheshvirus

Reputation: 7523

You have already specified the type of returning image file

eg.encodingType : 0

0 is for JPEG & 1 is for PNG

Upvotes: 1

Related Questions