From eeb6575008b0d603f4b1b419b7f44cb6c1c24aed Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Mon, 15 Jun 2020 11:11:12 -0400 Subject: [PATCH] Didn't work, just lower quality --- commands/edit-meme/deep-fry.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/commands/edit-meme/deep-fry.js b/commands/edit-meme/deep-fry.js index 2425f497..5232301f 100644 --- a/commands/edit-meme/deep-fry.js +++ b/commands/edit-meme/deep-fry.js @@ -36,11 +36,7 @@ module.exports = class DeepFryCommand extends Command { ctx.drawImage(data, 0, 0); desaturate(ctx, -20, 0, 0, data.width, data.height); contrast(ctx, 0, 0, data.width, data.height); - const firstExport = canvas.toBuffer('image/jpeg', { quality: 0.3 }); - if (Buffer.byteLength(firstExport) > 8e+6) return msg.reply('Resulting image was above 8 MB.'); - const firstExportImg = await loadImage(firstExport); - ctx.drawImage(firstExportImg, 0, 0); - const attachment = canvas.toBuffer('image/jpeg', { quality: 0.3 }); + const attachment = canvas.toBuffer('image/jpeg', { quality: 0.2 }); if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.'); return msg.say({ files: [{ attachment, name: 'deep-fry.jpeg' }] }); } catch (err) {