I am using the getPicture function from @ionic-native/camera to get the file URI of the image. I have the cordova camera plugin and all the packages are updated. According to the documentation the default destination type option is File_URI. However, even when I explicitly specify my options with my default destination type as File_URI it returns a base64 string.
The source code is given below, am I missing something? Any help is appreciated.
import { Camera, CameraOptions } from '@ionic-native/camera';
openGallery(){
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY
}
this.camera.getPicture(options).then((imageURI) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
this.image_loc = imageURI;
console.log("The image location is as follows: " + this.image_loc);
}, (err) => {
// Handle error
});
}
Output in console:
