Highlight that dataURLToBlob is synchronous

This commit is contained in:
Daniel Gasienica
2018-02-13 11:36:21 -05:00
parent b9c6bf600f
commit fdc3ef289d
2 changed files with 3 additions and 3 deletions

View File

@@ -104,7 +104,7 @@
i = i - 1; i = i - 1;
// TODO: Replace with native `Canvas::toBlob`: // TODO: Replace with native `Canvas::toBlob`:
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob // https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
blob = window.dataURLToBlob( blob = window.dataURLToBlobSync(
canvas.toDataURL('image/jpeg', quality) canvas.toDataURL('image/jpeg', quality)
); );
quality = quality * maxSize / blob.size; quality = quality * maxSize / blob.size;
@@ -233,7 +233,7 @@
// TODO: Replace with native `Canvas::toBlob`: // TODO: Replace with native `Canvas::toBlob`:
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/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); resolve(blob);
}; };

View File

@@ -60,7 +60,7 @@
window.nodeSetImmediate(function() {}); window.nodeSetImmediate(function() {});
}, 1000); }, 1000);
window.dataURLToBlob = require('blueimp-canvas-to-blob'); window.dataURLToBlobSync = require('blueimp-canvas-to-blob');
window.loadImage = require('blueimp-load-image'); window.loadImage = require('blueimp-load-image');
window.ProxyAgent = require('proxy-agent'); window.ProxyAgent = require('proxy-agent');
window.EmojiConvertor = require('emoji-js'); window.EmojiConvertor = require('emoji-js');