Skip to content

Frame portraits at the shape they are cropped to - #17

Merged
ShaalaXIV merged 2 commits into
mainfrom
claude/portrait-aspect
Sep 24, 2026
Merged

ShaalaXIV merged 2 commits into
mainfrom
claude/portrait-aspect

Conversation

@ShaalaXIV

Copy link
Copy Markdown
Owner

Every face on every card was stretched 4.2% taller than it was cropped.

shape frame height
stored portrait 600×720 (5:6) width × 1.2
editor crop preview size / PortraitAspect width × 1.2 ✓
card portrait size * 1.25f (4:5) width × 1.25 ✗

Small enough that nobody can name it, large enough that everybody can see it.

The shape is now a single pair of numbers in ProfileLimits — PortraitWidth, PortraitHeight, PortraitAspect — read by the crop preview, the upload and the card. Three places that had to agree and were never made to.

Two related fixes fall out:

  • The Chronicle's list thumbnail drew a 5:6 portrait into a square box, squashing it. It now centre-crops instead.
  • A picture chosen but not yet uploaded was drawn in the preview without the crop the editor was showing, so the preview framed it differently from what the upload would produce. It now carries the crop.

No stored data changes — portraits are already 600×720, they were simply being drawn into the wrong frame.

🤖 Generated with Claude Code

ShaalaXIV and others added 2 commits September 23, 2026 19:25
Every face on every card was stretched 4% taller than it was cropped.

A portrait is cropped and stored at 600x720, which is 5:6, and the editor's crop
preview framed it that way. The card framed it at width x 1.25, which is 4:5.
The difference is small enough that nobody can name it and large enough that
everybody can see it.

The shape is now a single pair of numbers in ProfileLimits, and the crop
preview, the stored image and the card all read it. Three places that had to
agree and were never made to.

Two related fixes fall out of it:

- The Chronicle's list thumbnail drew a 5:6 portrait into a square box, which
  squashed it. It now takes the middle of the picture rather than crushing it.
- A picture chosen but not yet uploaded was drawn in the preview without the
  crop the editor was showing, so the preview framed it differently from the
  upload. It now carries the crop.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The gate asserted the crop workflow by matching the literals 600 and 720 in the
editor, so moving them into ProfileLimits read as the workflow being torn out.
It now asserts what actually has to hold: the shared constants exist with those
values, the editor reads them, and the card frames a portrait at
ProfileLimits.PortraitAspect rather than a ratio of its own.

That is the invariant this commit exists to protect. The gate should fail if
somebody hardcodes a portrait frame again, not if somebody stops.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ShaalaXIV
ShaalaXIV merged commit 63abd9d into main Sep 24, 2026
1 check passed
@ShaalaXIV
ShaalaXIV deleted the claude/portrait-aspect branch September 24, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant