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

Function normalizeCustomEmojiBuffer

quote/quote.ts:1091–1102  ·  view source on GitHub ↗
(buffer: Buffer | undefined)

Source from the content-addressed store, hash-verified

1089async function probeAnimatedInfo(buffer: Buffer): Promise<{ fps: number; duration: number }> {
1090 const tmpBase = path.join(os.tmpdir(), `telebox_quote_probe_${Date.now()}_${Math.random().toString(16).slice(2)}`);
1091 const input = `${tmpBase}.bin`;
1092 try {
1093 fs.writeFileSync(input, buffer);
1094 const out = await execFileCaptureAsync("ffprobe", [
1095 "-v", "error",
1096 "-select_streams", "v:0",
1097 "-show_entries", "stream=avg_frame_rate,r_frame_rate,duration:format=duration",
1098 "-of", "default=noprint_wrappers=1:nokey=0",
1099 input,
1100 ], 10000);
1101 const data = new Map<string, string>();
1102 out.split(/\r?\n/).forEach((line) => {
1103 const idx = line.indexOf("=");
1104 if (idx > 0) data.set(line.slice(0, idx), line.slice(idx + 1));
1105 });

Callers 1

Calls 3

looksLikeAnimatedEmojiFunction · 0.85
getSharpFunction · 0.85

Tested by

no test coverage detected