[<<][webdev][>>][..]
Wed Dec 19 12:51:23 EST 2018

Set image data

https://stackoverflow.com/questions/13416800/how-to-generate-an-image-from-imagedata-in-javascript

img.src = "data:image/gif;base64,iVBORw0KGg..."

The post mentions imagedata.

http://www.websiteoptimization.com/speed/tweak/inline-images/

I already have a way to deliver binary data over websocket.  Can this
just be dumped without encoding to base64?

https://www.w3schools.com/tags/canvas_putimagedata.asp

Or just do this ArrayBuffer to base64 conversion in the browser?

Create a jpg image from ArrayBuffer data:
https://gist.github.com/candycode/f18ae1767b2b0aba568e

var arrayBufferView = new Uint8Array( this.response );
var blob = new Blob( [ arrayBufferView ], { type: "image/jpeg" } );
var urlCreator = window.URL || window.webkitURL;
var imageUrl = urlCreator.createObjectURL( blob );
var img = document.querySelector( "#photo" );
img.src = imageUrl;





[Reply][About]
[<<][webdev][>>][..]