Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Last active August 2, 2017 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/6fb13a3dc1f2ceed4ee3e8128ea67a5a to your computer and use it in GitHub Desktop.
Save matthieu-D/6fb13a3dc1f2ceed4ee3e8128ea67a5a to your computer and use it in GitHub Desktop.
grabPicture() {
const options: CameraOptions = {
quality: 100,
targetHeight: 200,
targetWidth: 200,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
this.loading = this.loadingCtrl.create({
content: 'Please wait...'
});
this.loading.present();
this.selectedPhoto = this.dataURItoBlob('data:image/jpeg;base64,' + imageData);
this.upload();
}, (err) => {
console.log('error', err);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment