diff --git a/js/views/file_input_view.js b/js/views/file_input_view.js index 5aca2b03ed..7377215c01 100644 --- a/js/views/file_input_view.js +++ b/js/views/file_input_view.js @@ -104,7 +104,7 @@ i = i - 1; // TODO: Replace with native `Canvas::toBlob`: // https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob - blob = window.dataURLToBlob( + blob = window.dataURLToBlobSync( canvas.toDataURL('image/jpeg', quality) ); quality = quality * maxSize / blob.size; @@ -233,7 +233,7 @@ // TODO: Replace with native `Canvas::toBlob`: // https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob - var blob = window.dataURLToBlob(canvas.toDataURL('image/png')); + var blob = window.dataURLToBlobSync(canvas.toDataURL('image/png')); resolve(blob); }; diff --git a/preload.js b/preload.js index 0060ebd59a..587ed4a895 100644 --- a/preload.js +++ b/preload.js @@ -60,7 +60,7 @@ window.nodeSetImmediate(function() {}); }, 1000); - window.dataURLToBlob = require('blueimp-canvas-to-blob'); + window.dataURLToBlobSync = require('blueimp-canvas-to-blob'); window.loadImage = require('blueimp-load-image'); window.ProxyAgent = require('proxy-agent'); window.EmojiConvertor = require('emoji-js');