I want take a picture and show it in iphone,I used
<img [src]="imagePath"/>
in home.html,and in home.ts, add cordova-plugin-camera to take a picture,
as following:
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI, //DATA_URL
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
saveToPhotoAlbum: true,
}
this.camera.getPicture(options).then((imageUri) => { //imageData, if DATA_URL
//if DATA_URL
//let base64Image = 'data:image/jpeg;base64,' + imageData;
//this.imagePath = base64Image; //the image can be show in screen
//if FILE_URI
this.imagePath = imageUri;});//cannot show image
},(err) => {// Handle error
});
I want to add image url in SQLite, so how can I fix it?