{"record":{"id":"be9505f59e81fa1d","repo":"jackwener/OpenCLI","slug":"instagram-private-story-publish-does-not-support-a","errorCode":null,"errorMessage":"Instagram private story publish does not support auto-normalizing ${asset.fileName} on ${process.platform}","messagePattern":"Instagram private story publish does not support auto-normalizing (.+?) on (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/instagram/_shared/private-publish.js","lineNumber":373,"sourceCode":"        const detail = [result.error?.message, result.stderr, result.stdout]\n            .map((value) => String(value || '').trim())\n            .filter(Boolean)\n            .join(' ');\n        throw new CommandExecutionError(`Instagram private publish failed to normalize ${asset.fileName}`, detail || 'sips padToHeightWidth failed');\n    }\n    return {\n        ...readImageAsset(outputPath),\n        cleanupPath: outputPath,\n    };\n}\nexport function prepareImageAssetForPrivateStoryUpload(filePath) {\n    const asset = readImageAsset(filePath);\n    const normalizedDimensions = getInstagramStoryNormalizedDimensions(asset.width, asset.height);\n    if (!normalizedDimensions) {\n        return asset;\n    }\n    if (process.platform !== 'darwin') {\n        throw new CommandExecutionError(`Instagram private story publish does not support auto-normalizing ${asset.fileName} on ${process.platform}`, `Use images within ${INSTAGRAM_MIN_STORY_ASPECT_RATIO.toFixed(2)}-${INSTAGRAM_MAX_STORY_ASPECT_RATIO.toFixed(2)} aspect ratio, or use the UI route`);\n    }\n    const outputPath = buildPrivateNormalizedImagePath(filePath);\n    const result = spawnSync('sips', [\n        '--padToHeightWidth',\n        String(normalizedDimensions.height),\n        String(normalizedDimensions.width),\n        '--padColor',\n        INSTAGRAM_PRIVATE_PAD_COLOR,\n        filePath,\n        '--out',\n        outputPath,\n    ], {\n        encoding: 'utf8',\n    });\n    if (result.error || result.status !== 0 || !fs.existsSync(outputPath)) {\n        const detail = [result.error?.message, result.stderr, result.stdout]\n            .map((value) => String(value || '').trim())\n            .filter(Boolean)","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/instagram/_shared/private-publish.js#L355-L391","documentation":"Story images outside Instagram's story aspect ratio range must be padded to normalized dimensions using macOS `sips`; on any non-darwin platform automatic story normalization is unsupported and this error is thrown.","triggerScenarios":"prepareImageAssetForPrivateStoryUpload gets non-null getInstagramStoryNormalizedDimensions (ratio outside story range) while process.platform !== 'darwin'.","commonSituations":"Publishing a square or landscape image as a story on Linux/Windows, CI pipelines producing assets not sized 9:16.","solutions":["Pre-pad/crop the image to the story aspect ratio (9:16) before upload","Use the UI route instead of the private route","Run the publish on macOS where sips-based normalization is available","Adjust your asset-generation pipeline to emit story-sized images"],"exampleFix":"// before\nawait publishStory({ media: 'square.png' }); // fails on linux\n// after\n// $ magick square.png -background black -gravity center -extent 1080x1920 story.png\nawait publishStory({ media: 'story.png' });","handlingStrategy":"validation","validationCode":"const { width, height } = sizeOf(filePath);\nconst ratio = width / height;\nconst ok = ratio >= 0.5625 * 0.9 && ratio <= 0.5625 * 1.1; // ~9:16 story\nif (!ok && process.platform !== 'darwin') {\n  throw new Error('pad the image to 9:16 first');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await publishStory(cfg);\n} catch (e) {\n  if (/story publish does not support auto-normalizing/.test(e.message)) {\n    cfg.media = padToStoryRatio(cfg.media); // pre-pad to 1080x1920, retry\n  } else throw e;\n}","preventionTips":["Generate story assets at 9:16 (1080x1920) upstream","Run story publishing on macOS or pre-pad images yourself","Validate story image dimensions before each publish","Use the UI route when on non-macOS platforms"],"tags":["instagram","story","platform-limitation","macos"],"backgroundTag":"image-aspect-ratio-unsupported","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}