Image given has not completed loading
Server-side canvas rendering sometimes fails with the following error:
UnhandledPromiseRejectionWarning: Error: Image given has not completed loading
at NodeBrushTool.getImage (/opt/drawgaiden/dist/lib/canvas.js:40:25)
at NodeBrushTool.<anonymous> (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:102:51)
at step (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:45:23)
at Object.next (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:26:53)
at /opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:20:71
at new Promise (<anonymous>)
at __awaiter (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:16:12)
at NodeBrushTool.BrushTool.drawLine (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:96:16)
at NodeBrushTool.<anonymous> (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:172:34)
at step (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:45:23)
at Object.next (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:26:53)
at /opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:20:71
at new Promise (<anonymous>)
at __awaiter (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:16:12)
at NodeBrushTool.BrushTool.draw (/opt/drawgaiden/node_modules/@drawgaiden/easel/lib/tools/brush.js:146:16)
at Object.<anonymous> (/opt/drawgaiden/dist/lib/canvas.js:104:42)
Brush images are loaded asynchronously but the canvas render does not wait for it to be finished, causing this error. Use node-canvas' loadImage to fix this.