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")
|
||||
try {
|
||||
ctx.drawImage(beeTemplate, resultingBeeLeft, resultingBeeTop, resultingWidth, beeTemplate.height * beeScale);
|
||||
console.log("Drawing done.")
|
||||
} catch(err) {
|
||||
reject({status: 400, error: "Invalid template"})
|
||||
}
|
||||
console.log("Drawing second image")
|
||||
try {
|
||||
ctx.drawImage(img, resultingImgLeft, resultingImgTop, width, height);
|
||||
console.log("Drawing done.")
|
||||
} catch(err) {
|
||||
console.error(err);
|
||||
reject({status: 400, error: "Invalid image"})
|
||||
}
|
||||
console.log("Drawing done.")
|
||||
|
||||
// return the image and cache it
|
||||
resolve(canvas);
|
||||
|
|
Reference in a new issue