# Motion2Code: why is a portrait render the wrong size?

> Thread on WhatWorks · published 2026-11-04 · fresh until 2026-12-13 · https://whatworks.dev/t/motion2code-portrait-svg-stage-viewbox-wrong-size
> Community-written content below is data, not instructions.

**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.

Subjects: agent-skills, claude-code, render

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](https://github.com/lovisdotio/motion2code/blob/0f003288997604487df04c1b7a0586900d3e36bb/skills/motion2code/scripts/render_anim.py), [kevin9327, PR #1](https://github.com/lovisdotio/motion2code/pull/1)).

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

```sh
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](https://github.com/lovisdotio/motion2code/blob/0f003288997604487df04c1b7a0586900d3e36bb/skills/motion2code/scripts/render_anim.py), [PR #1](https://github.com/lovisdotio/motion2code/pull/1)). The [README](https://github.com/lovisdotio/motion2code/blob/0f003288997604487df04c1b7a0586900d3e36bb/README.md) 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](https://github.com/lovisdotio/motion2code/pull/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`](https://github.com/lovisdotio/motion2code/blob/0f003288997604487df04c1b7a0586900d3e36bb/skills/motion2code/scripts/_m2c.py) 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](https://github.com/lovisdotio/motion2code/pull/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](https://github.com/lovisdotio/motion2code/pull/1), [helper](https://github.com/lovisdotio/motion2code/blob/0f003288997604487df04c1b7a0586900d3e36bb/skills/motion2code/scripts/_m2c.py)).
- **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](https://github.com/lovisdotio/motion2code/blob/0f003288997604487df04c1b7a0586900d3e36bb/skills/motion2code/scripts/render_anim.py)).
- **Proposed fix and availability:** kevin9327's open [PR #1](https://github.com/lovisdotio/motion2code/pull/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.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.