TODO: Use native `Canvas::toBlob`

One challenge is that `Canvas::toBlob` is async whereas `dataURLtoBlob` is sync.
This commit is contained in:
Daniel Gasienica 2018-02-09 16:43:23 -05:00
parent b15c304a31
commit 06dba5eb8f
1 changed files with 4 additions and 0 deletions

View File

@ -104,6 +104,8 @@
do {
i = i - 1;
// dataURLtoBlob -> components/blueimp-canvas-to-blob
// TODO: Replace with native `Canvas::toBlob`:
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
blob = dataURLtoBlob(
canvas.toDataURL('image/jpeg', quality)
);
@ -229,6 +231,8 @@
});
// dataURLtoBlob -> components/blueimp-canvas-to-blob
// TODO: Replace with native `Canvas::toBlob`:
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
var blob = dataURLtoBlob(canvas.toDataURL('image/png'));
resolve(blob);