From 733345bb959f282da61665e022756431c0a9d88c Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 15 Sep 2022 18:47:00 +0530 Subject: [PATCH] fix: jimp thumb gen --- src/Utils/messages-media.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Utils/messages-media.ts b/src/Utils/messages-media.ts index dd7e103..9463f72 100644 --- a/src/Utils/messages-media.ts +++ b/src/Utils/messages-media.ts @@ -115,16 +115,17 @@ export const extractImageThumb = async(bufferOrFilePath: Readable | Buffer | str const { read, MIME_JPEG, RESIZE_BILINEAR, AUTO } = lib.jimp const jimp = await read(bufferOrFilePath as any) + const dimensions = { + width: jimp.getWidth(), + height: jimp.getHeight() + } const buffer = await jimp .quality(50) .resize(width, AUTO, RESIZE_BILINEAR) .getBufferAsync(MIME_JPEG) return { buffer, - original: { - width: jimp.getWidth(), - height: jimp.getHeight() - } + original: dimensions } } }