syscall/js: copyBytesTo(Go|JS) could accept Uint8ClampedArray #38011
Labels
arch-wasm
WebAssembly issues
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
syscall/js: copyBytesTo(Go|JS) could accept Uint8ClampedArray
When compiling Go to WebAssembly (with go 1.13) you can get a great help from
syscall/js
to interact with JS and web APIs.One limitation is in reading and updating canvas pixel data with
(get|put)ImageData
, because we need an intermediary translation betweenUint8ClampedArray
andUint8Array
. OderwiseCopyBytesToGo
panics, also we can't use aImageData
like object withUint8Array
data, or theputImageData
will fail.However,
Uint8ClampedArray
is just a sugaryUint8Array
. I see no problem to makecopyBytesTo(Go|JS)
accepts that as a source or destiny.What did you do?
What did you expect to see?
jsImgData
filled to be puted in a canvasWhat did you see instead?
The log
syscall/js: CopyBytesToJS: expected dst to be an Uint8Array
.The text was updated successfully, but these errors were encountered: