fixed thing

This commit is contained in:
CBenni 2017-12-07 03:58:54 +01:00
parent b200b9c873
commit 793dccd0fc

View file

@ -67,16 +67,18 @@ function bee(url, size) {
console.log("Drawing first image") console.log("Drawing first image")
try { try {
ctx.drawImage(beeTemplate, resultingBeeLeft, resultingBeeTop, resultingWidth, beeTemplate.height * beeScale); ctx.drawImage(beeTemplate, resultingBeeLeft, resultingBeeTop, resultingWidth, beeTemplate.height * beeScale);
console.log("Drawing done.")
} catch(err) { } catch(err) {
reject({status: 400, error: "Invalid template"}) reject({status: 400, error: "Invalid template"})
} }
console.log("Drawing second image") console.log("Drawing second image")
try { try {
ctx.drawImage(img, resultingImgLeft, resultingImgTop, width, height); ctx.drawImage(img, resultingImgLeft, resultingImgTop, width, height);
console.log("Drawing done.")
} catch(err) { } catch(err) {
console.error(err);
reject({status: 400, error: "Invalid image"}) reject({status: 400, error: "Invalid image"})
} }
console.log("Drawing done.")
// return the image and cache it // return the image and cache it
resolve(canvas); resolve(canvas);