Does anyone have an idea of what this is?
base64 / binary / hex??
This is an image data, but I don't know how to display it.
OMIT THIS STRING as it's manually added: data:image/png; base64,
Does anyone have an idea of what this is?
base64 / binary / hex??
This is an image data, but I don't know how to display it.
OMIT THIS STRING as it's manually added: data:image/png; base64,
Try using JavaScript's image object. Like this:
let base64Img = new Image();
base64Img.src = "data:image/png;base64,*rest of data here*...";
And then you can put that image object into your HTML something like this:
document.querySelector(*yourCSSselector*).appendChild(base64Img);
Edit: You said it wasn't working so I looked into it a bit more.
I encoded this image: https://i.picsum.photos/id/78/536/354.jpg
Using the tool at https://www.base64-image.de/
I then made a codepen to display that image in a simple HTML file: https://codepen.io/seancowan-dev/pen/jOEdJvy?editors=1011
new Image();
should work if you are passing it a correctly formatted Data URI. So lets take a look at what is in your URI to make sure it is properly formatted base64.
Can you screenshot a console.log(base64Img)
so we can see what's in there?