Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resultType: CameraResultType.Uri
})
console.log('Got image back', image.path, image.webPath, image.format, image.exif);
const imageData = await Filesystem.readFile({
path: image.path
});
await Filesystem.writeFile({
path: 'cool-photo.jpg',
directory: FilesystemDirectory.Data,
data: imageData.data
});
let stat = await Plugins.Filesystem.stat({
path: 'cool-photo.jpg',
directory: FilesystemDirectory.Data
});
console.log(stat);
//this.image = this.sanitizer.bypassSecurityTrustResourceUrl("data:image/jpeg;base64," + imageData.data);
const imageUrl = image.webPath;
this.image = this.sanitizer.bypassSecurityTrustResourceUrl(imageUrl);
}
return this.doAll(paths, path => Plugins.Filesystem.rmdir({path}));
}