Browse Source

Scale faces to be 1.5 times bigger

denikson 6 years ago
parent
commit
4ff501a4cb
1 changed files with 2 additions and 1 deletions
  1. 2 1
      main.js

+ 2 - 1
main.js

@@ -120,7 +120,8 @@ async function processFaceSwap(message, attachmentUrl) {
         let ew = emojiImage.getWidth();
         let eh = emojiImage.getHeight();
 
-        let scaleFactor = Math.max(bw, bh) / Math.max(ew, eh);
+        const CONSTANT_SCALE = 1.5;
+        let scaleFactor = Math.max(bw, bh) / Math.min(ew, eh) * CONSTANT_SCALE;
         ew *= scaleFactor;
         eh *= scaleFactor;