fix jimp 2

This commit is contained in:
Victor Calazans 2025-07-09 22:16:19 -03:00
parent f58e792506
commit abe25d2c77

View File

@ -2100,10 +2100,9 @@ export class ChatwootService {
const nameFile = `${random}.${mimeTypes.extension(mimeType)}`;
const fileData = Buffer.from(imgBuffer.data, 'binary');
const img = await Jimp.fromBuffer(fileData);
const img = await Jimp.read(fileData);
img.cover(320, 180);
const processedBuffer = await img.getBuffer('image/png');
const processedBuffer = await img.getBufferAsync(Jimp.MIME_PNG || 'image/png');
const fileStream = new Readable();
fileStream._read = () => {}; // _read is required but you can noop it