-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
44 lines (36 loc) · 1.02 KB
/
script.js
File metadata and controls
44 lines (36 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// const Jimp = require("jimp");
// const fs = require('fs');
// const path = require('path');
// const Promise = require('bluebird');
//
//
// const MASK = fs.readFileSync(path.join(__dirname, 'rounde_mask.png'));
//
// Jimp.read(Buffer.from(MASK))
// .then(mask => {
// return mask;
// })
const foo = () => {
};
foo(console.log(1), console.log(2), console.log(3));
// Promise.all([
// Jimp.read("https://s3-eu-west-1.amazonaws.com/memegenerator.dev/0b/0b3fa603a0e5a401abb21472bd190bdb.png"),
// Jimp.read("./rounde_mask.png")
// ])
// .spread((image, mask) => {
// mask.resize(image.bitmap.width, image.bitmap.height);
//
// return image.mask(mask, 0, 0);
// })
// .then(image => {
// return new Promise(resolve => {
// image.getBuffer(Jimp.MIME_PNG, (error, result) => resolve(result))
// });
// })
// .then(imageBuffer => {
// fs.writeFileSync('result.png', imageBuffer, "binary");
// })
// .catch(error => {
// console.log(error)
// })
// .finally(() => process.exit(0));