Frame portraits at the shape they are cropped to - #17
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every face on every card was stretched 4.2% taller than it was cropped.
size / PortraitAspectsize * 1.25f(4:5)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:
No stored data changes — portraits are already 600×720, they were simply being drawn into the wrong frame.
🤖 Generated with Claude Code