@sharatdotinfo wrote:
Hi,
I just wrote a simple app using Capacitor to capture an image and display in the app and it’s working fine on the web browser on my laptop but just the image piece doesn’t work on devapp. Not sure how to fix it. Any help is appreciated.
Here is some code I used:
export class UploadPage {
yourImage: SafeResourceUrl;constructor(private sanitizer: DomSanitizer) { }
async captureImage() {
const capturedImage = await Plugins.Camera.getPhoto(
{
quality: 90,
allowEditing: false,
source: CameraSource.Camera,
resultType: CameraResultType.DataUrl
}
);this.yourImage = this.sanitizer.bypassSecurityTrustResourceUrl(capturedImage && (capturedImage.dataUrl));
}
}
Posts: 2
Participants: 2