Repository navigation
Preview: zoom and pan for images - #118
Closed
crustovsky wants to merge 1 commit into
Closed
crustovsky wants to merge 1 commit into
crustovsky wants to merge 1 commit into
Conversation
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>
Owner
Author
|
Merged into main through #123. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.core::fullFrameAllowed).src/app/imageview.cpp.Tests:
test_windowpreviewZoom(key, carry-over, reset, wheel limits, the reply of a file since left),test_hostilefullFrameBound. ctest passes.🤖 Generated with Claude Code