Skip to content

Preview: zoom and pan for images - #118

Closed
crustovsky wants to merge 1 commit into
extract-conflictsfrom
image-zoom
Closed

crustovsky wants to merge 1 commit into
extract-conflictsfrom
image-zoom

Conversation

@crustovsky

Copy link
Copy Markdown
Owner

Fixes #114. Stacked on #117.

  • PreviewZoom, default Ctrl+0: a previewed image between fit and 100%, around the pointer when it is over the picture. In the F9 View menu and the help.
  • Over the preview the wheel zooms around the pointer (fit to 400%) and a drag pans. Focus stays in the list.
  • Past the fitted frame's resolution the file is decoded at its own size by a second loader; the fitted frame stays on screen until it arrives. Bounded at 64 megapixels (core::fullFrameAllowed).
  • Zoom and position carry over to the next image of the same pixel size; anything else resets to fit.
  • The level shows on the details line ("shown at 100%").
  • The picture widget is now src/app/imageview.cpp.

Tests: test_window previewZoom (key, carry-over, reset, wheel limits, the reply of a file since left), test_hostile fullFrameBound. ctest passes.

🤖 Generated with Claude Code

The image preview only fitted the picture to the slot, so it could not
say whether a photo is sharp, which is the question when culling a
folder with Insert and F8.

PreviewZoom (Ctrl+0, the View menu, the help) switches a previewed
image between fit and 100%, around the pointer when it is over the
picture, else around the middle. Over the preview the wheel zooms
around the pointer between fit and 400% and a drag pans; the keyboard
has no pan and focus never leaves the list. The level is told on the
details ("Dimensions: 6000 × 4000, shown at 100%"), nothing is drawn
over the picture.

The picture widget moved out of preview.cpp into imageview.cpp. The
fitted frame is about the slot's size (rule 16), so past its resolution
the view asks for the file at its own size: a second ImageLoader decodes
it, the fitted frame stays up scaled until it arrives, and at 100% and
above the file's pixels are shown unsmoothed. Only the shown file's full
frame is kept; going back to fit or leaving the file frees it, and a
reply for a file since left is dropped by the loader (rule 4).
core::fullFrameAllowed bounds a full frame at 256 MiB (64 megapixels)
in 64-bit arithmetic; larger images stay at the fitted frame, and the
loader refuses a frame that turns out larger than that.

Zoom and position carry over to the next image of the same pixel size,
so a burst is compared on one detail a key at a time. Another size, a
file that is not an image, or closing the preview goes back to fit.
Thumbnails, PDF pages and video frames only fit.

Ctrl+0 has no function key beside it: every Ctrl+F slot is taken, and
it sits with the other keys of the preview's content (Ctrl+P,
Ctrl+PgUp), which are chords as well.

Fixes #114

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@crustovsky

Copy link
Copy Markdown
Owner Author

Merged into main through #123.

@crustovsky crustovsky closed this Nov 30, 2026
@crustovsky
crustovsky deleted the image-zoom branch November 30, 2026 21:00
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