Closed usrtax closed 2 years ago
when I delete encode, the error is error: Uncaught (in promise) TypeError: Invalid FFI pointer type, expected null, integer or BigInt
+ deno run --unstable -A test.js
Uint8Array(223418) [
137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68,
82, 0, 0, 3, 32, 0, 0, 3, 32, 8, 6, 0, 0, 0, 219,
112, 6, 104, 0, 3, 104, 129, 73, 68, 65, 84, 120, 156, 236, 253,
125, 172, 37, 231, 125, 223, 9, 214, 83, 85, 247, 165, 95, 216, 162,
152, 38, 77, 133, 140, 68, 135, 132, 69, 209, 145, 32, 197, 14, 163,
216, 227, 73, 35, 241, 174, 55, 26, 5, 144, 98, 216, 142, 227, 137,
200, 205, 219, 172, 181, 99, 197, 246, 96, 118,
... 223318 more items
] 223418
error: Uncaught (in promise) TypeError: Invalid FFI pointer type, expected null, integer or BigInt
let rawResult = _lib.symbols.toWebp(a0, a0.byteLength, a1)
It's not TextEncoder, encode
function returns back the input its a TypedArray
@usrtax
deno_bindgen cannot return binary data which included by structs because struct is always convert to the JavaScript's Object through JSON.parse
I think If you want to return binary, you have two choice.