MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / extractFirstFrame

Function extractFirstFrame

ai/ai.ts:653–659  ·  view source on GitHub ↗
(buffer: Buffer)

Source from the content-addressed store, hash-verified

651
652const extractFirstFrame = async (buffer: Buffer): Promise<Buffer | null> => {
653 try {
654 return await sharp(buffer, { animated: true }).png().toBuffer();
655 } catch {
656 return null;
657 }
658};
659
660const getDocumentThumb = (doc: Api.Document): Api.TypePhotoSize | undefined => {
661 const thumbs = doc.thumbs || [];
662 if (thumbs.length === 0) return undefined;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected