MCPcopy Create free account
hub / github.com/TanStack/ai / parseNativeImageSize

Function parseNativeImageSize

packages/ai-gemini/src/image/image-provider-options.ts:314–321  ·  view source on GitHub ↗
(
  size: string,
)

Source from the content-addressed store, hash-verified

312 * Format: "aspectRatio_resolution" e.g. "16:9_4K" → { aspectRatio: "16:9", resolution: "4K" }
313 */
314export function parseNativeImageSize(
315 size: string,
316): { aspectRatio: string; resolution: string } | undefined {
317 const match = size.match(/^(\d+:\d+)_(.+)$/)
318 const [, aspectRatio, resolution] = match ?? []
319 if (aspectRatio === undefined || resolution === undefined) return undefined
320 return { aspectRatio, resolution }
321}

Callers 2

generateWithGeminiApiMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected