i am unable to understand what path i should use to show image on UI img src tag please help.
i am getting file path of image but unable to set.
let options = {
quality: 30,
allowEdit: true,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
saveToPhotoAlbum: false,
correctOrientation: true,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imagePath) => {
if (this.platform.is('android')) {
this.filePath.resolveNativePath(imagePath)
.then(filePath => {
this.setPhotoOnUI = filePath;
this.lastImage = this.createFileName();
// let correctPath = filePath.substr(0, filePath.lastIndexOf('/') + 1);
// let currentName = imagePath.substring(imagePath.lastIndexOf('/') + 1, imagePath.lastIndexOf('?'));
// this.copyFileToLocalDir(correctPath, currentName, this.createFileName());
});
} else {
// var currentName = imagePath.substr(imagePath.lastIndexOf('/') + 1);
// var correctPath = imagePath.substr(0, imagePath.lastIndexOf('/') + 1);
// this.copyFileToLocalDir(correctPath, currentName, this.createFileName());
}
});