Converting Base64 string to img src

Hello People

I have successfully made and button with cordova camera and im able to upload images from camera and camera storage to firebase and when it does that im storing the base64 string under the a user profile in firebase aswell so i can pull the string from the current user profile and hopefully generate a url og picture from that.

Given the fact that i have the base64 string how do i convert that to show and image in my app again?

//TS 
picImage:any;  //variable
this.picImage = "data:image/jpeg;base64,"+this.base64Data;  //this.base64Data contains base64 string

//HTML
<img [src]="picImage" >
4 Likes

YOU MY FRIEND ARE AWESOME! :smiley:

Thank you very much! Saved me hours of searching Google for retarded answers where i have to write millions of lines of code hahaha :D!!!

2 Likes

It work for me thank you ! :smile:

2 Likes