@tanstack/ai
Version:
Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.
21 lines (20 loc) • 440 B
JavaScript
function detectImageMimeType(base64Data) {
const prefix = base64Data.substring(0, 20);
if (prefix.startsWith("/9j/")) {
return "image/jpeg";
}
if (prefix.startsWith("iVBORw0KGgo")) {
return "image/png";
}
if (prefix.startsWith("R0lGOD")) {
return "image/gif";
}
if (prefix.startsWith("UklGR")) {
return "image/webp";
}
return void 0;
}
export {
detectImageMimeType
};
//# sourceMappingURL=utils.js.map