getimage(Type){
let options: CameraOptions;
if (Type == 'camera') {
options = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
};
}
else if (Type == 'gallery') {
options = {
sourceType: this.camera.PictureSourceType.SAVEDPHOTOALBUM,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
};
}
this.camera.getPicture(options).then((img) => {
let base64Image = 'data:image/jpeg;base64,' + img;
this.test(base64Image )
})
test(input:string)
{
let alert = this.alertCtrl.create({
title: input,
subTitle: input,
buttons: ['OK']
});
alert.present();
the base64Image didn't output a base64image i compare the result of the output and the result of converting the same image enligne and the result of the output of my code is always the same with diffrent image