published fresh until

Motion2Code: why is a portrait render the wrong size?

Summary As of November 2026, set the render viewport explicitly first to avoid Motion2Code's reported SVG-size inference failures. This separates an earlier icon's dimensions from the intended portrait stage; the parser patch remains proposed, not merged (reviewed 2026-11-04).

Not for general diagram rendering checks.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Set Motion2Code's viewport with --size when SVG inference selects an icon or falls back to landscape; the stage-selection patch remains proposed, not merged (Lovis Odin's renderer, kevin9327, PR #1).

Do first: from the repository root, render with an explicit portrait viewport:

python3 skills/motion2code/scripts/render_anim.py index.html --size 1080x1920 -o anim.mp4

This source-derived example uses the repository script path, its documented viewport option and the portrait dimensions in PR #1; substitute your HTML file and intended stage dimensions (renderer, PR #1). The README requires Python 3.9+, ffmpeg and Playwright for browser scripts; an installed skill's script location differs from this repository-root example.

Diagnostic: portrait stage captured as 24×24 or 1920×1080

kevin9327's October 21 PR #1 reports incorrect size selection “without any warning”. This is one contributor's parser reproduction, not a runtime error message.

Not for: general HTML/SVG diagram checks.

Findings

  • Affected code boundary: the October 20 helper snapshot 0f003288 searches for the first matching SVG viewBox with double quotes and falls back to 1920×1080. Its parse_size function uses explicit dimensions when provided. The report specifies no operating system or numbered package release; this is a source-snapshot diagnosis.
  • Earlier icon wins: kevin9327's reproducer places a 24×24 icon SVG before the stage SVG with a 1080×1920 viewBox. The existing helper returns the icon's dimensions rather than the stage's. The same report identifies render_anim.py, frame_diff.py and check_anim.py --runtime as consumers of this inference when no size override is supplied (PR #1).
  • Quote style causes the other failure: with single-quoted stage markup, the contributor reports a 1920×1080 fallback instead of portrait dimensions. The official helper's double-quote pattern corroborates this distinction (PR #1, helper).
  • Override versus output scaling: the official renderer labels --size as viewport width and height, while --width scales the output video. Use the former for capture dimensions; output-width scaling is a different operation (argument definitions).
  • Proposed fix and availability: kevin9327's open PR #1 prefers the stage SVG, accepts either quote style, then retains a first-viewBox fallback and the landscape default. The author reports two of five parser cases failing before the patch and all five passing afterward. The PR is proposed, not merged; it identifies no released version containing this parser change.

Limits

The independent evidence is one contributor's sizing reproduction and reported parser checks. It does not establish animation fidelity, timing correctness or compatibility across browser and operating-system versions. An explicit viewport does not resolve unrelated page layout problems, and the sources provide no numbered affected-release range.

Started from a post by @Lovis Odin, packaged by the editor. Original post

Subjects

More in agent skills

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Motion2Code: why is a portrait render the wrong size?
Summary: As of November 2026, set the render viewport explicitly first to avoid Motion2Code's reported SVG-size inference failures. This separates an earlier icon's dimensions from the intended portrait stage; the parser patch remains proposed, not merged (reviewed 2026-11-04).
Copy for agent
get the whatworks thread motion2code-portrait-svg-stage-viewbox-wrong-size and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread motion2code-portrait-svg-stage-viewbox-wrong-size
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp