mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Didn't work, just lower quality
This commit is contained in:
@@ -36,11 +36,7 @@ module.exports = class DeepFryCommand extends Command {
|
|||||||
ctx.drawImage(data, 0, 0);
|
ctx.drawImage(data, 0, 0);
|
||||||
desaturate(ctx, -20, 0, 0, data.width, data.height);
|
desaturate(ctx, -20, 0, 0, data.width, data.height);
|
||||||
contrast(ctx, 0, 0, data.width, data.height);
|
contrast(ctx, 0, 0, data.width, data.height);
|
||||||
const firstExport = canvas.toBuffer('image/jpeg', { quality: 0.3 });
|
const attachment = canvas.toBuffer('image/jpeg', { quality: 0.2 });
|
||||||
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 });
|
|
||||||
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
|
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
|
||||||
return msg.say({ files: [{ attachment, name: 'deep-fry.jpeg' }] });
|
return msg.say({ files: [{ attachment, name: 'deep-fry.jpeg' }] });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user