/** * Image utilities for saving and processing images */ /** * Strip data URL prefix from base64 string if present. * Returns { mimeType, base64 } where mimeType is extracted from the prefix (or undefined). * Handles formats like "data:image/png;base64,iVBOR..." returned by xAI API for 2k resolution. */ export declare function stripDataUrlPrefix(data: string): { mimeType?: string; base64: string; }; /** * Detect actual image format from buffer magic bytes and return the correct extension. */ export declare function detectImageExtension(buffer: Buffer): string; /** * Replace the file extension of a path, preserving the base name. */ export declare function replaceExtension(filePath: string, newExt: string): string; /** * Save base64 image data to file. * Handles data URL prefix (e.g. "data:image/png;base64,...") and * corrects file extension to match actual image format. * Returns the actual output path used (extension may differ from input). */ export declare function saveBase64Image(base64Data: string, outputPath: string): Promise; /** * Download image from URL and save to file */ export declare function downloadAndSaveImage(url: string, outputPath: string): Promise; /** * Validate aspect ratio format */ export declare function validateAspectRatio(aspectRatio: string): boolean; /** * Get file extension from output format or path */ export declare function getImageExtension(outputPath: string): string; /** * Generate thumbnail data from image file */ export declare function generateThumbnailData(imagePath: string, maxWidth?: number, maxHeight?: number): Promise; /** * Check if thumbnail generation is enabled via environment variable */ export declare function isThumbnailEnabled(): boolean; /** * Create MCP content object with thumbnail */ export declare function createThumbnailContent(base64Data: string): { type: string; data: string; mimeType: string; }; //# sourceMappingURL=image.d.ts.map