Hello. I’m trying to prepare image for sending to the server from gallery or camera. Started with gallery. Using cordova-plugin-camera. I’m getting an image URL like
content://media/external/images/media/27494/
when I use it in img src="{{URL}}"
I get broken-link icon , or grey background in case if ion-img
I'm submitting a ... (check one with "x") [ x ] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
Current behavior:
Hello. I’m trying to prepare image for sending to the server from gallery or camera. Started with gallery. Using cordova-plugin-camera. I’m getting an image URL like content://media/external/images/media/27494/
when I use it in img src="{{URL}}"
I get broken-link icon , or grey background in case if ion-img
`<>
Please Select `Image!
<<.ts>> options: CameraOptions = { quality: 50, destinationType: 2, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE, sourceType: 0, }; public presentActionSheet() { let actionSheet = this.actionSheetCtrl.create({ title: 'Select Image Source', buttons: [ { text: 'Load from Library', handler: () => { this.camera.getPicture(this.options).then((imageData) => { this.lastImage = this.sanitizer.bypassSecurityTrustUrl(imageData); this.lastImageNotSanitized = imageData; }, (err) => { this.presentToast('Error.'); }); } }, { text: 'Cancel', role: 'cancel' } ] }); actionSheet.present(); } `
Expected behavior:
<img style="width: 200px; height: 60px;" ngIf="lastImage" src="content://media/external/images/media/27494/"> <ion-img style="width: 200px; height: 60px;" ngIf="lastImage" src="content://media/external/images/media/27494/">
those should show images, not broken link icons
Steps to reproduce:
code is above, I'm using ionic view application on meizu 5, android 6.0
Related code:
code is above
Other information:
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):