Dispaly photo ionic 2


#1

hey,
i’m try to display photo after took it in the same page
i did something like that but it’s not working
the photo:**

takePicture(){
Camera.getPicture({
quality : 95,
destinationType : Camera.DestinationType.DATA_URL,
sourceType : Camera.PictureSourceType.CAMERA,
allowEdit : true,
encodingType: Camera.EncodingType.PNG,
targetWidth: 500,
targetHeight: 500,
saveToPhotoAlbum: true
}).then(imageData => {
console.log(“img1:”+imageData);
this.notePicture = “data:image/jpeg;base64,” + imageData;
console.log(“img2:”+this.notePicture);

}, error => {
  console.log("ERROR -> " + JSON.stringify(error));
});

}

in html

  <img src="notePicture" *ngIf="notePicture"/>

it shows me error on the photo and wrote this error

Failed to load resource: net::ERR_FILE_NOT_FOUND


#2

Try


#3

that’s works!!!
what the difference between to <img [src]=“notePicture”>

thank you @Ellezo


#4

notePicture is a variable holding the real value.
while,

notePicture is the real value


#5

thank you very much!