LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
Merge PR #2280: #2253: crop ratios keep the orientation asked for
aiongg6196ebb968ab
diff --cc crates/engine/src/lib.rsindex c046df639,676544258..0bd5c03d7--- a/crates/engine/src/lib.rs+++ b/crates/engine/src/lib.rs@@@ -1295,10 -1249,10 +1295,12 @@@ mod tests_albums_local#[cfg(test)]mod tests_color;#[cfg(test)]+mod tests_constrain_crop;+#[cfg(test)]mod tests_crop_angle;#[cfg(test)]+ mod tests_crop_aspect;+ #[cfg(test)]mod tests_denoise;#[cfg(test)]mod tests_export;diff --cc crates/ui-egui/src/lib.rsindex c19e85018,83603e038..b953e1a85--- a/crates/ui-egui/src/lib.rs+++ b/crates/ui-egui/src/lib.rs@@@ -722,12 -715,12 +722,13 @@@ impl LightcraftApp/// Called only after a crop gesture begins, inside its undo transaction.pub(crate) fn begin_crop(&mut self) -> Result<(), String> {+ // nothing chosen yet: the photo's own shape, as `crop_tool_aspect` shows it+ let aspect = self.ui.crop_default_aspect.clone().unwrap_or_else(|| serde_json::json!("original"));if self.session.interaction.is_some()&& self.session.active().and_then(|id| self.session.develop_of(id)).is_some_and(|d| d.crop == lightcraft_develop::Crop::default())- && let Some(aspect) = self.ui.crop_default_aspect.clone()&& aspect != serde_json::json!("free")- && let Err(e) = self.session.execute("crop.aspect", &serde_json::json!({"aspect": aspect}))+ // the remembered ratio, turned like the new photo's crop (as a named ratio is)+ && let Err(e) = self.session.execute("crop.aspect", &serde_json::json!({"aspect": aspect, "orientation": "crop"})){// A remembered value the command refuses (a hand-edited settings file) would refuse// every crop drag on an untouched photo: forget it and let this drag go ahead.diff --cc docs/parity-checklist.mdindex fa3b26f4e,3ebda6d38..2a5670b5a--- a/docs/parity-checklist.md+++ b/docs/parity-checklist.md@@@ -250,7 -250,7 +250,7 @@@ differences and missing bindings are i| Id | Feature | Tier | Status | Evidence | Missing / notes ||---|---|---|---|---|---|| LR-CROP-RECT | Crop rectangle | P0 | ✅ | `cmd:crop.set`, `cmd:crop.drag`, `crates/geom/src/crop_drag.rs`, `crates/ui-egui/src/panels/detail.rs` | double-click inside the box applies the crop (like Return) |- | LR-CROP-ASPECT | Aspect ratios | P0 | ✅ | `cmd:crop.aspect`, `cmd:crop.rotateAspect`, `crates/ui-egui/src/panels/right.rs` | menu with presets + custom W × H, visible Lock toggle (also A), button names the active ratio; every handle honours the lock, holding Shift while dragging a handle keeps the frame's proportions for that drag (issue #614), and the drag stops at the image edge instead of shifting the frame (issue #295); "Original" is the photo's own shape (no separate As Shot); the last chosen aspect is saved as a crop tool default, resolving Original per photo and preserving existing crops; opening Crop or browsing never edits a photo: the default applies only when a crop gesture starts, within its single undo step; a crop starts locked to the photo's own shape until the Lock is switched off once, then as last set (#991) |-| LR-CROP-ASPECT | Aspect ratios | P0 | ✅ | `cmd:crop.aspect`, `cmd:crop.rotateAspect`, `crates/ui-egui/src/panels/right.rs` | menu with presets + custom W × H (a preset takes the crop's orientation, portrait after X; a custom ratio is used as entered, issue #2253), visible Lock toggle (also A), button names the active ratio; every handle honours the lock, holding Shift while dragging a handle keeps the frame's proportions for that drag (issue #614), and the drag stops at the image edge instead of shifting the frame (issue #295); "Original" is the photo's own shape (no separate As Shot); the last chosen aspect is saved as a crop tool default, resolving Original per photo and preserving existing crops; opening Crop or browsing never edits a photo: the default applies only when a crop gesture starts, within its single undo step |++| LR-CROP-ASPECT | Aspect ratios | P0 | ✅ | `cmd:crop.aspect`, `cmd:crop.rotateAspect`, `crates/ui-egui/src/panels/right.rs` | menu with presets + custom W × H (a preset takes the crop's orientation, portrait after X; a custom ratio is used as entered, issue #2253), visible Lock toggle (also A), button names the active ratio; every handle honours the lock, holding Shift while dragging a handle keeps the frame's proportions for that drag (issue #614), and the drag stops at the image edge instead of shifting the frame (issue #295); "Original" is the photo's own shape (no separate As Shot); the last chosen aspect is saved as a crop tool default, resolving Original per photo and preserving existing crops; opening Crop or browsing never edits a photo: the default applies only when a crop gesture starts, within its single undo step; a crop starts locked to the photo's own shape until the Lock is switched off once, then as last set (#991) || LR-CROP-STRAIGHTEN | Straighten tool | P0 | ✅ | `cmd:crop.straighten`, `cmd:crop.autoStraighten`, `crates/ui-egui/src/panels/detail.rs` (`rotate_cursor`, `angle_readout`), `crates/ui-egui/src/panels/right.rs` (Angle field), `crates/ui-egui/src/tests_crop_rotate.rs` | Straighten Tool button: drag along a horizon/vertical; double-click or Auto levels automatically. Dragging outside the crop box rotates it: there the pointer is a curved double arrow that bulges away from the side of the box it is on, diagonally off a corner and following a rotated box (`rotate_cursor_turn`, tested by `rotate_cursor_faces_away_from_the_crop_box`) (with ⌘ held, the straighten crosshair), and while rotating the angle shows next to it, kept on the canvas (issue #534); an exact angle goes in the Angle field under Straighten (`cropAngleField`: applies on Return or leaving it, Esc keeps the old angle, takes a decimal comma; a drag on it is one undo step) or by clicking the Straighten value (its hover says so). Every way of setting the angle (rotate handle, Straighten slider, Angle field, `crop.straighten`, `crop.set {angle}`, and the generic `develop.set` / `develop.adjust` / `develop.quickAdjust` / `develop.resetControl` on `crop.angle`, as MCP, the control channel and `lightcraft-cli render --set` use them) keeps the crop if it still fits, else shrinks it about its own centre, keeping its aspect, until it fits; the full photo (or a crop an earlier turn shrank to the largest of its aspect) stays the largest, so it grows back towards 0° (issue #1388), and no other crop ever grows (issue #1794: a crop dragged in from a corner turned into nearly the whole photo) (`CropGeometry::with_angle`, `crates/engine/src/tests_crop_angle.rs`; before issue #742 the generic path left the box, and the export, past the photo with smeared edge pixels in the corners). The dimming outside the box is the photo minus the (rotated) box, drawn as one mesh (`outside_crop_mesh`), so rotating never dims wedges inside the box or doubles them outside (issue #731) || LR-CROP-AUTO | Auto straighten | P1 | ✅ | `cmd:crop.autoStraighten` | crop-angle leveling from detected horizon/plumb lines (consensus required) || LR-CROP-ANGLE | Angle slider | P0 | ✅ | `ctl:crop.angle`, `crates/ui-egui/src/panels/right.rs` | the Straighten slider; an exact angle can also be typed in the Angle field under it (see LR-CROP-STRAIGHTEN); setting `crop.angle` through `develop.set` fits the crop inside the photo as Straighten does (issue #742) |diff --cc docs/whats-new.mdindex f6bec2f8d,d99edeba3..3a9033456--- a/docs/whats-new.md+++ b/docs/whats-new.md@@@ -1,20 -1,12 +1,27 @@@# What's new in LightCraft+## 2026-10-19++### Hidden Local locations come back one at a time+- With several locations removed from Local, "Show N hidden locations" now lists them, so each comes back on its own+ (Restore All is there too). The row used to bring every hidden location back at once (issue #2114).++ ## 2026-10-18++ ### Portrait crop ratios stay portrait+ - A crop ratio no longer flips to the photo's orientation (issue #2253): after X turns the crop portrait, picking+ another ratio (4 × 5, 2 × 3…) keeps it portrait, as in Lightroom, and a Custom ratio taller than wide gives a+ portrait crop.++## 2026-10-15++### Constrain Crop tightens the crop you see+- Geometry ▸ Constrain Crop now changes the crop itself, as in Lightroom (issue #1927). Ticking it, or moving a+ Geometry slider, Upright or a lens correction while it is ticked, shrinks the crop about its centre until the blank+ corners left by the correction are gone, and the Crop tool shows the tighter crop. Before, it only applied when the+ photo was shown outside the Crop tool, so in the Crop panel, where the checkbox is, nothing seemed to change. A crop+ you draw by hand is kept as drawn, and unticking keeps the tighter crop.+## 2026-10-14### Model downloads time out on a name that doesn't resolve