You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Global marketshare tells us that it's down at < 1% (0.7% in fact)
Switch to using canvas.toBlob() instead.
Even doe it's async it much faster since it don't have to encode the image data to base64 only to be decoded again by converting it to binary data again when you convert it into a Uint8Array. then you can do blob.arrayBuffer().then(do_something) afterwards
Using toBlob would mean that it would become async only - so drop all the sync code?
typedarray-to-buffer isn't really necessary. you can just safely do Buffer.from(arrayBuffer) or Buffer.from(uint8.buffer)
The uint8 array you produce don't have any byteOffsets or anything like that.
typedarray-to-buffer is such a small package that it can be inlined.
Really don't think you should be returning a Node Buffer, I think a Uint8Array is way better. It's more lightweight and don't depend on any nodejs stuff
canvas.toBlob()instead.blob.arrayBuffer().then(do_something)afterwardstypedarray-to-bufferisn't really necessary. you can just safely doBuffer.from(arrayBuffer)orBuffer.from(uint8.buffer)