When using the Cameara to take a picture with destinationType: this.camera.DestinationType.FILE_URI
, the resulting URL will not work to display the image. For example, when attempting to take a photo like this:
this.camera.getPicture(options).then((url) => {
// Load Image
this.imagePath = url;
}, (err) => {
console.log(err);
});
Attempting to display it as <img [src]="imagePath" >
will result in an error (file not found).
The problem here is that the URL is in the file:///storage...
path instead of the correct one based on localhost.