[Feature]: Add Crop and Mirror Tools #147

Closed
opened 2026-07-08 21:32:08 +00:00 by ValleyGeek · 2 comments
Owner

Problem or use case

Allow the user to crop and flip the image from the Grid's image viewer

Proposed solution

When the user enters the image viewer on the grid workbench:

  • The "Thumbnail Size" slider and labels should be hidden
  • Update the dynamic toolbar with the following
    • Move the button for "Rotate 90" from the toolbox to the dynamic toolbar
    • Add a button labelled "< >" to mirror the image horizontally
      • The change is visually applied immediately and follows the same save pattern as rotate
    • Add a crop button
      • Pressing the button draws a black line around the image that can be drug from the four corners or the four sides to resize
      • The area on the image, outside the back border, is dimmed as it's resized
      • Clicking and dragging anywhere inside the border allows it to be moved within the frame, stopping if it hits an edge. The frame is fixed in size and cannot be moved outside the bounds of the image
      • Pressing enter accepts the crop and applies it immediately. A backup of the original image is kept in an ".originals" directory
        • This directory is omitted from scans
        • Cropping should be added to the undo and redo history, restoring the original image or reapplying the crop
      • A setting is available on the settings workbench to have the .originals directory purged and removed after the close of the session
    • An "Accept" button is added that's active while cropping, pressing confirms the crop and makes the button inactive
    • A "Crop Mode" drop-down menu is added
      • with the following options:
        • None
        • Keep Aspect
        • 16:9
        • 4:3
      • Add a few other common ratios
      • Add a setting to choose the default mode
### Problem or use case Allow the user to crop and flip the image from the Grid's image viewer ### Proposed solution When the user enters the image viewer on the grid workbench: - The "Thumbnail Size" slider and labels should be hidden - Update the dynamic toolbar with the following - Move the button for "Rotate 90" from the toolbox to the dynamic toolbar - Add a button labelled "< >" to mirror the image horizontally - The change is visually applied immediately and follows the same save pattern as rotate - Add a crop button - Pressing the button draws a black line around the image that can be drug from the four corners or the four sides to resize - The area on the image, outside the back border, is dimmed as it's resized - Clicking and dragging anywhere inside the border allows it to be moved within the frame, stopping if it hits an edge. The frame is fixed in size and cannot be moved outside the bounds of the image - Pressing enter accepts the crop and applies it immediately. A backup of the original image is kept in an ".originals" directory - This directory is omitted from scans - Cropping should be added to the undo and redo history, restoring the original image or reapplying the crop - A setting is available on the settings workbench to have the .originals directory purged and removed after the close of the session - An "Accept" button is added that's active while cropping, pressing confirms the crop and makes the button inactive - A "Crop Mode" drop-down menu is added - with the following options: - None - Keep Aspect - 16:9 - 4:3 - Add a few other common ratios - Add a setting to choose the default mode
Member

Implemented on branch 0.3.6/issue-147-crop-mirror (pushed).

Grid viewer dynamic toolbar (thumbnail-size slider hidden when entering viewer from grid):

  • Rotate 90° moved from right panel to dynamic toolbar
  • < > horizontal mirror (immediate preview, debounced disk write like rotation)
  • Crop button with interactive overlay (black border, dimmed exterior, corner/side resize, interior drag)
  • Accept button + Enter confirm; Esc cancels crop mode
  • Crop Mode dropdown: None, Keep Aspect, 16:9, 4:3, 3:2, 2:3, 1:1, 21:9

Persistence & undo:

  • Crop backs up originals under .originals/ (omitted from scans)
  • Crop is undo/redo via QUndoStack (session-only)
  • Settings: default crop aspect mode; optional purge .originals on workspace close / app exit

Tests: tests/test_viewer_crop_mirror.py plus updated PR8 viewer right-panel count.

Ready for review; PR to main on request.

Implemented on branch `0.3.6/issue-147-crop-mirror` (pushed). **Grid viewer dynamic toolbar** (thumbnail-size slider hidden when entering viewer from grid): - Rotate 90° moved from right panel to dynamic toolbar - `< >` horizontal mirror (immediate preview, debounced disk write like rotation) - Crop button with interactive overlay (black border, dimmed exterior, corner/side resize, interior drag) - Accept button + Enter confirm; Esc cancels crop mode - Crop Mode dropdown: None, Keep Aspect, 16:9, 4:3, 3:2, 2:3, 1:1, 21:9 **Persistence & undo:** - Crop backs up originals under `.originals/` (omitted from scans) - Crop is undo/redo via QUndoStack (session-only) - Settings: default crop aspect mode; optional purge `.originals` on workspace close / app exit **Tests:** `tests/test_viewer_crop_mirror.py` plus updated PR8 viewer right-panel count. Ready for review; PR to `main` on request.
Member

Implemented on branch 0.3.6/issue-147-crop-mirror and opened as a PR targeting main for release 0.4.0.

Delivered (issue #147):

  • Grid viewer dynamic toolbar: rotate 90°, horizontal mirror, crop overlay (handles, dim exterior, aspect presets + ↻ orientation flip), Accept / Enter apply, Esc cancel
  • Pre-crop backup under workspace .originals/ (scanner skips it); session undo/redo for crop with thumbnail/viewer refresh
  • Settings: default crop aspect; optional purge of .originals on session close
  • DR-033, USER_GUIDE / DESIGN / TECHNICAL_OUTLINE / CHANGELOG updates

Closing this issue when the PR merges.

Implemented on branch `0.3.6/issue-147-crop-mirror` and opened as a PR targeting `main` for release **0.4.0**. **Delivered (issue #147):** - Grid viewer dynamic toolbar: rotate 90°, horizontal mirror, crop overlay (handles, dim exterior, aspect presets + ↻ orientation flip), Accept / Enter apply, Esc cancel - Pre-crop backup under workspace `.originals/` (scanner skips it); session undo/redo for crop with thumbnail/viewer refresh - Settings: default crop aspect; optional purge of `.originals` on session close - DR-033, USER_GUIDE / DESIGN / TECHNICAL_OUTLINE / CHANGELOG updates Closing this issue when the PR merges.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ai-collab/bulk-image-organizer#147
No description provided.