mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
471 B
20 lines
471 B
6 years ago
|
const gm = require('@tohru/gm')
|
||
6 years ago
|
, configs = require(__dirname+'/../../configs/main.json')
|
||
|
, uploadDirectory = require(__dirname+'/../uploadDirectory.js');
|
||
6 years ago
|
|
||
|
module.exports = (filename) => {
|
||
|
|
||
|
return new Promise((resolve, reject) => {
|
||
|
gm(uploadDirectory + filename)
|
||
|
.resize(128, 128)
|
||
|
.noProfile()
|
||
6 years ago
|
.write(`${uploadDirectory}thumb-${filename.split('.')[0]}.png`, function (err) {
|
||
6 years ago
|
if (err) {
|
||
|
return reject(err);
|
||
|
}
|
||
|
});
|
||
|
return resolve();
|
||
|
});
|
||
|
|
||
|
};
|