MCPcopy Create free account
hub / github.com/Rfym21/Qwen2API / parseMaybeJSON

Function parseMaybeJSON

src/controllers/chat.image.video.js:590–605  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

588}
589
590/**
591 * 规范化 OpenAI 风格尺寸参数
592 * @param {string} size - 原始尺寸
593 * @returns {string|undefined} 规范化后的尺寸
594 */
595const normalizeOpenAIImageVideoSize = (size) => {
596 if (!size) {
597 return undefined
598 }
599
600 const normalizedSizeMap = {
601 '1024x1024': '1:1',
602 '1536x1024': '4:3',
603 '1024x1536': '3:4',
604 '1792x1024': '16:9',
605 '1024x1792': '9:16'
606 }
607
608 return normalizedSizeMap[size] || size

Callers 2

ensureArrayFunction · 0.85
extractInlineMediaURLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected