Update chatwoot.service.ts

This commit is contained in:
Jose Sanchis 2025-07-16 11:27:46 +02:00 committed by GitHub
parent 8b0b59d8fb
commit 4f947286dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,7 +26,7 @@ import axios from 'axios';
import { proto } from 'baileys';
import dayjs from 'dayjs';
import FormData from 'form-data';
import Jimp, { MIME_PNG } from 'jimp';
import { Jimp } from 'jimp';
import Long from 'long';
import mimeTypes from 'mime-types';
import path from 'path';
@ -2103,7 +2103,8 @@ export class ChatwootService {
const img = await Jimp.read(fileData);
await img.cover(320, 180);
const processedBuffer = await img.getBufferAsync(MIME_PNG);
const mime = img.getMIME();
const processedBuffer = await img.getBufferAsync(mime);
const fileStream = new Readable();
fileStream._read = () => {}; // _read is required but you can noop it