Hi I was trying to show the image retrieved from a mp3 file in a image tag using html and reactjs. This is the code I used.
async getImageFromUploadedFile(framesRetrieved){
const imageArrayBufferRetrieved = framesRetrieved[4].value.data;
var blob = new Blob([imageArrayBufferRetrieved]);
var reader = new FileReader();
reader.onload = function(event){
var base64 = event.target.result;
};
reader.readAsDataURL(blob);
}
when I console the base64 image I got something like this. screen capture of the base64 image
I tried to show the retrieved image using this code
<Grid item xs={12}>
<Grid item container xs={6}>
<div id="title"></div>
<img src="data:image/png;base64,base64"/>
<div id="audioContainer"></div>
<div id="lyricsContainer"></div>
</Grid>
</Grid>
But the image does not appear in the tag. There is no console errors. Great if you can help. Thanks.