fixed thing
This commit is contained in:
parent
b200b9c873
commit
793dccd0fc
1 changed files with 3 additions and 1 deletions
4
index.js
4
index.js
|
@ -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);
|
||||||
|
|
Reference in a new issue