Skip to content

A width on its own means that width - #32

Merged
thousandflowers merged 1 commit into
mainfrom
fix/resize-width
Sep 5, 2026
Merged

thousandflowers merged 1 commit into
mainfrom
fix/resize-width

Conversation

@thousandflowers

Copy link
Copy Markdown
Owner

Resizing filled the side nobody named in with the original and handed both to min(). The unasked side always has a ratio of exactly 1, so it silently became the floor: asking for 1600 wide on an 800 pixel picture scaled by min(2, 1) and gave back 800 — a resize that did nothing.

Only the sides actually asked for decide the scale now. cropCenter had the same shape of bug through max(). The box a crop or a pad is fitted into still uses the original for the side nobody named — that part was right.

The preset editor's Resize action defaults to exactly this shape (a width, no height), so it was reachable in one click. From the CLI it needs --resize 1600x, which the parser already accepted.

Test plan

  • swift test — 349 green, three new: upscale to a width, downscale to a width, and a box where the wide side is what fits
  • Real CLI: 800x600 --resize 1600x → 1600x1200
  • CI on macos-14

🤖 Generated with Claude Code

https://claude.ai/code/session_018H9CZxWumc3ryumgEHd578

Resizing filled the side nobody named in with the original, then handed
both to min(). The unasked side always has a ratio of exactly 1, so it
silently became the floor: asking for 1600 wide on an 800 pixel picture
scaled by min(2, 1) and gave back 800, which reads as a resize that did
nothing at all.

Only the sides that were actually asked for decide the scale now. The
box a crop or a pad is fitted into still uses the original for the side
nobody named - that part was right.

Downscaling, which is what everybody was doing, behaves exactly as
before, and both directions are now tested.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018H9CZxWumc3ryumgEHd578
@thousandflowers
thousandflowers merged commit 2df8ebe into main Sep 5, 2026
1 check passed
@thousandflowers
thousandflowers deleted the fix/resize-width branch September 5, 2026 22:45
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