diff --git a/core/display.js b/core/display.js index 213b1df77..f3c3478fd 100644 --- a/core/display.js +++ b/core/display.js @@ -382,15 +382,24 @@ export default class Display { 'y': y }; - const img = new Image(); - img.src = "data: " + mime + ";base64," + Base64.encode(arr); - if (img.complete) { - a.img = img; - } else { - img.addEventListener('load', () => { + if (window.createImageBitmap) { + let blob = new Blob([arr], { type: mime }); + createImageBitmap(blob) + .then((img) => { a.img = img; this._scan_renderQ(); }); + } else { + const img = new Image(); + img.src = "data: " + mime + ";base64," + Base64.encode(arr); + if (img.complete) { + a.img = img; + } else { + img.addEventListener('load', () => { + a.img = img; + this._scan_renderQ(); + }); + } } this._renderQ_push(a);