Replace the center-crop cover resize with a Sobel edge-density smart crop (SaliencySmartCropper). The pipeline crops to the target aspect, then does a pure resize. Same-aspect inputs skip the crop entirely, and any error falls back to the centered crop with a warning.
Search only the max-fitting window. The 85% and 70% candidate sizes could never outscore the full-size window containing them, because edge energy is never negative. Always check the last x/y position so subjects at the right or bottom edge aren't cut off.
Add SaliencySmartCropperTests: it biases toward the edge-heavy side on both axes, reaches the edge for a subject touching it, and returns an in-bounds rect at the target aspect. Add the asymmetric-edges golden fixture and regenerate the existing goldens.
Update SPEC.md §3.2, PLAN.md and IMPLEMENTATION.md, and tick the MQTT auto-reconnect increment that landed in #1.
Test plan
dotnet test: 185/185 pass
Smoke test: upload a 16:9 photo to a 4:3 frame and check the subject is kept
## Summary
- Replace the center-crop cover resize with a Sobel edge-density smart crop (`SaliencySmartCropper`). The pipeline crops to the target aspect, then does a pure resize. Same-aspect inputs skip the crop entirely, and any error falls back to the centered crop with a warning.
- Search only the max-fitting window. The 85% and 70% candidate sizes could never outscore the full-size window containing them, because edge energy is never negative. Always check the last x/y position so subjects at the right or bottom edge aren't cut off.
- Add `SaliencySmartCropperTests`: it biases toward the edge-heavy side on both axes, reaches the edge for a subject touching it, and returns an in-bounds rect at the target aspect. Add the `asymmetric-edges` golden fixture and regenerate the existing goldens.
- Update SPEC.md §3.2, PLAN.md and IMPLEMENTATION.md, and tick the MQTT auto-reconnect increment that landed in #1.
## Test plan
- [x] `dotnet test`: 185/185 pass
- [x] Smoke test: upload a 16:9 photo to a 4:3 frame and check the subject is kept
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Replace the center-crop cover resize with a Sobel edge-density search
that picks the target-aspect window with the most edge energy, so a
subject off-center isn't sliced when the input aspect differs from the
frame's. Failures fall back to the centered crop. Golden fixtures are
regenerated and an asymmetric-edges input exercises the bias.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Edge energy is non-negative, so the 85% and 70% candidate windows could
never outscore the full-size window containing them; drop them. Also
always evaluate the last x/y position so a subject touching the right
or bottom edge isn't cut by up to one step of grid misalignment.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The golden fixtures only prove determinism; these assert the crop
actually biases toward the edge-rich side on both axes, reaches the
source edge for an edge-hugging subject, and always returns an in-bounds
rect at the target aspect.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
SaliencySmartCropper). The pipeline crops to the target aspect, then does a pure resize. Same-aspect inputs skip the crop entirely, and any error falls back to the centered crop with a warning.SaliencySmartCropperTests: it biases toward the edge-heavy side on both axes, reaches the edge for a subject touching it, and returns an in-bounds rect at the target aspect. Add theasymmetric-edgesgolden fixture and regenerate the existing goldens.Test plan
dotnet test: 185/185 pass🤖 Generated with Claude Code