mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-30 05:23:05 +00:00
11 lines
273 B
JavaScript
11 lines
273 B
JavaScript
/**
|
|
* Save a <canvas> element's content to a Blob object.
|
|
*
|
|
* @param {HTMLCanvasElement} canvas
|
|
* @returns {Promise}
|
|
*/
|
|
export default function canvasToBlob (canvas, type, quality) {
|
|
return new Promise((resolve) => {
|
|
canvas.toBlob(resolve, type, quality)
|
|
})
|
|
}
|