0
I am receiving images from a server and need to display the image on the html page. The images are received via socket, so I have only the content of the image. The img tag displays an image when there is src, in which case would it be necessary to save the image on the client side and then display it? Thank you for your attention.
In what format the image is received, Base64?
– BrTkCa
I’m not sure what format. I use a library to extract the image from a mjpeg video on the server and send it to the client.
– Bruno Clementino
If you are Base64, this may help you: http://answall.com/a/169877/32827
– BrTkCa
@Lucascosta thanks for your help. To work I needed to do just this: var b64Response = btoa(image); Document.querySelector("#myimage"). src ='data:image/jpeg;Base64,'+b64Response; http://stackoverflow.com/questions/20784145/display-image-from-http-response-with-image-content-type
– Bruno Clementino
Cool @Brunoclementino, answer your question :)
– BrTkCa