From: Vincent Vanwaelscappel Date: Mon, 12 Jun 2023 08:47:43 +0000 (+0200) Subject: wip #6012 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3782383cbfdb2aef49de96613e61c029159a6baa;p=fluidbook-html5.git wip #6012 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.loader.js b/js/libs/fluidbook/fluidbook.loader.js index c70949b7..5d0c0402 100644 --- a/js/libs/fluidbook/fluidbook.loader.js +++ b/js/libs/fluidbook/fluidbook.loader.js @@ -638,16 +638,21 @@ FluidbookLoader.prototype = { ctx.globalAlpha = 1; } - var i = new Image(); - i.onload = function () { - if (enter) { - $this.textures[page] = i; - } else { - $this.leaveTextures[page] = i; + try { + let dataurl = c.toDataURL("image/png"); + var i = new Image(); + i.onload = function () { + if (enter) { + $this.textures[page] = i; + } else { + $this.leaveTextures[page] = i; + } + callback(); } + i.src = dataurl; + } catch (e) { callback(); } - i.src = c.toDataURL("image/png"); }); },