How can I create a canvas imageData array from an arrayBuffer representation of a JPG
问题 First of all I am aware there are standard methods of achieving this (readAsDataURL and drawImage), but unfortunately they are not usable for this specific use case. I am reading an image using the filereader API as an arraybuffer like so: var reader = new fileReader(); reader.onload = function(e){ var byteArray = new Uint8ClampedArray(e.target.result); //do stuff to this array } reader.readAsArrayBuffer(file); I am then creating a clampedarray with this returned data. What I want to be able