MCPcopy Index your code
hub / github.com/MiniMax-AI/cli / localFileToDataUri

Function localFileToDataUri

src/utils/image.ts:13–18  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

11};
12
13export function localFileToDataUri(filePath: string): string {
14 const ext = extname(filePath).toLowerCase();
15 const mime = IMAGE_MIME_TYPES[ext] || 'image/jpeg';
16 const data = readFileSync(filePath);
17 return `data:${mime};base64,${data.toString('base64')}`;
18}
19
20export function resolveImageInput(input: string): string {
21 return input.startsWith('http') ? input : localFileToDataUri(input);

Callers 3

runFunction · 0.90
resolveImageInputFunction · 0.85
toDataUriFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected