|
|
@ -9,7 +9,6 @@ module.exports = class Blur {
|
|
|
|
async getImage(image, level) {
|
|
|
|
async getImage(image, level) {
|
|
|
|
if (!image) throw new Error(`You must provide an image.`);
|
|
|
|
if (!image) throw new Error(`You must provide an image.`);
|
|
|
|
image = await jimp.read(image);
|
|
|
|
image = await jimp.read(image);
|
|
|
|
image.resize(480, 480);
|
|
|
|
|
|
|
|
image.blur(isNaN(level) ? 5 : parseInt(level));
|
|
|
|
image.blur(isNaN(level) ? 5 : parseInt(level));
|
|
|
|
let raw;
|
|
|
|
let raw;
|
|
|
|
image.getBuffer(`image/png`, (err, buffer) => {
|
|
|
|
image.getBuffer(`image/png`, (err, buffer) => {
|
|
|
|