Skip to content

LR-EXP-WATERMARK: rotate the watermark in quarter turns (#827, stacked on #845) - #847

Merged
bflatastic merged 4 commits into
storytold:mainfrom
john01px2022:john01px2022/watermark-rotate
Oct 11, 2026
Merged

bflatastic merged 4 commits into
storytold:mainfrom
john01px2022:john01px2022/watermark-rotate

Conversation

@john01px2022

@john01px2022 john01px2022 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Part of #827. Stacked on #845 (which is stacked on #833): review only the last commit.

Lightroom Classic's watermark editor can rotate a watermark in 90° steps. This adds the same.

What changed

  • New Watermark.rotation and watermark key rotation: 0, 90, 180 or 270 degrees clockwise, default 0. Any other value is an error from app.export / MCP, like the other watermark checks. Settings saved without the key draw unturned.
  • Works for text (horizontal and vertical) and graphics. The watermark is laid out unturned, then each pixel position is turned in whole quarter turns (exact, no resampling) and placed by the turned box. So:
    • size and graphic width are measured before turning, and rotating never resizes the watermark
    • the anchor and both insets apply to the turned box (a 270° watermark on the Right position reads bottom to top along the right edge, inset by the horizontal inset)
    • the drop shadow still falls down and to the right on the photo.
  • At rotation 0 the drawing code is unchanged, so existing exports are identical.
  • The Export dialog gets a "Rotate" row (0° / 90° / 180° / 270°) under Position. "Rotate" already has a translation in every catalog.
  • MCP tool descriptions and the LR-EXP-WATERMARK parity row updated.
prC-rotate-270-with-preview

Tests

  • watermark_rotation_turns_the_text_in_its_corner:
    • text at 90° and 270° is taller than wide, stays in its corner, and keeps the horizontal inset
    • 180° keeps its size and corner
    • an angle that isn't a quarter turn draws unturned
    • rotation saves and loads back, and old settings read as 0.
  • graphic_watermark_is_placed_scaled_and_blended: a half-transparent logo at 90°, 180° and 270° covers exactly the expected pixels.
  • watermark_params_are_validated: 45, -90, 360, "90" and 90.5 are errors, and 270 passes.
  • I merged this with LR-EXP-WATERMARK: preview the watermark in the Export dialog (#827) #843 (the watermark preview) in a local branch, and the preview shows the rotated watermark the same as the exported file.

Merge order note

#843 and this stack both edit the watermark tests and the LR-EXP-WATERMARK row in export.rs and docs/parity-checklist.md. Whichever lands second has a small conflict (keep both sides). I'll rebase whichever is second.

CI

cargo xtask ci steps pass except lightcraft-mcp e2e export_progress_and_cancel, which fails the same way on main on this machine (#674, fix in #668).

🤖 Generated with Claude Code

Ni-zav and others added 4 commits October 11, 2026 04:47
…torytold#827)

Watermark.inset becomes inset_x (from the left or right edge) and inset_y
(from the top or bottom edge), like Lightroom Classic's watermark editor.
The watermark keys are insetX and insetY; the old inset key still reads as
both, so saved presets and existing MCP calls keep working.

The Export dialog's Inset slider becomes Horizontal inset and Vertical
inset, each greyed out when the position is centred along its axis.
cargo fmt reflows WM_POSITIONS and its test from the previous commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A watermark (text, horizontal or vertical, or a graphic) can be turned 0,
90, 180 or 270 degrees clockwise, like Lightroom Classic's rotate buttons.
It is sized before it is turned and placed and inset by the turned box; the
shadow still falls down and to the right. New watermark key `rotation`
(other values are errors); settings without it draw unturned. The Export
dialog gets a Rotate row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants