From 06dba5eb8f662c11af3a9ba8395bb453ab2e5f8d Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Fri, 9 Feb 2018 16:43:23 -0500 Subject: [PATCH] TODO: Use native `Canvas::toBlob` One challenge is that `Canvas::toBlob` is async whereas `dataURLtoBlob` is sync. --- js/views/file_input_view.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/views/file_input_view.js b/js/views/file_input_view.js index d892286254..b5758d9a9a 100644 --- a/js/views/file_input_view.js +++ b/js/views/file_input_view.js @@ -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);