How to download a large canvas using streamsaver? #276
Debangshu132
started this conversation in
General
Replies: 1 comment
-
There isn't really any way to get the canvas image as a readable stream... there is mainly only two options...
a blob is a better binary container, and b/c you have a blob and not a readable stream then it's also a tiny bit useless to create a streamable download using streamsaver + service worker I would actually advice you not to use streamsaver at all... canvas.toBlob(blob => {
const a = document.createElement('a')
a.download = 'preview.png'
a.href = URL.createObjectURL(blob)
a.click()
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a large canvas generated on the client-side. The problem is when I am converting it into a buffer before using stream saver to download it, that operation itself is taking a lot of RAM. Any suggestions on this?
Beta Was this translation helpful? Give feedback.
All reactions