Base64 image are not showing

I have a Base64 string but when i put image sting like this <img src="{{item.image1}}">
but image are not sowing
how can i fixed that?
please help me out anyone
Thanks

try removing “item”.

Your item image string needs this prefix…

src=“data:image/png;base64,{{item.image1}}”

1 Like

please check here is my json response
Screenshot_9

are you sure it is inside item??

ya below my .ts file

 this.http.get(this.baseurl+this.user_id)
      .subscribe((res:Response)=>{
      let dataTemp = res.json(); //dataTemp is the json object you showed me
      this.mydata = dataTemp.GetAds; //contains a [] object with all yours user
     console.log(this.mydata[0].image1);   
    })

.html

<ion-card  *ngFor="let item of mydata">
  <ion-card-header>
    {{item.cat_name}}
  </ion-card-header>

  <ion-list>
    <button ion-item>
      <ion-icon name="cart" item-start color="iconColor"></ion-icon>
      Expected Price:{{item.price}}
    </button>

     <ion-card-content>
   {{item.post_desc}}
  </ion-card-content>
  </ion-list>
  <<img src="{{item.image1}}" alt="">
   <button ion-button full (click)="getdetails($event , item)">Get seller details</button>
</ion-card>

please check

Check your response in postman and then in json viewer.

Sorry? I dont understand . can you give me example of code .?

do you have postman installed in your system??

No. I will install just a moment

this is my post man output.

Copy that and paste it on json viewer…

Did you say this?
Capture

This is a base64 image, are you encoding and decoding it???

how can i do that using postman?

Where are these options?

No no it doesn’t require postman. I thought of something else.
I’ve gone far on that.
The main issue is you can’t see the image in your app right??

ya. below my base64 string please check it

data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAFRAcIDASIAAhEBAxEB/8QAGwAAAgMBAQEAAAAAAAAAAAAAAgMBBAUABgf/xAA0EAACAgEDAwMDAwMEAgMBAAAAAQIDEQQhMQUSQRMiURQycSMzYSRCgRU0UpFioSU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EobH7WLQyP2Mo2Ojr9Ifrdu38i+jr9AZrXvH8kUc8+nHJXZasw6YlV8gCQSyCAWCwmCygWCw2CADBYxgMAJC2xkgGgAbAYbQDAAF8htAtBAMhhNAsAc/wcdg4D1Nq7JuPwJbG27zf5FqLbNolRklnGzE6l7I1ddGMNPRBJZ7csx9RL3YIoIDorYTDfC8luFWF7gIp109M/mPwXl1XTy5W5VUalzHIalWl7a0ZirEeo1yeIw/9BPWyi9oFSVrj9sEKWrs7sSSEF6WtnLZxKlksts71nIGbyi4mlSluD3HSANIapHWPNbFoKf2EFSP3FylZKsF7

Something is wrong with your image as I cannot decode it through online tools.

Screenshot%20(47)

https://www.base64decode.org/ try on this site and just remove this data:image/jpeg;base64, letter its working