Skip to content

Improvements - #660

Open
Buggfix42 wants to merge 10 commits into
easymodo:masterfrom
Buggfix42:better-zoom-qimgv-public
Open

Improvements#660
Buggfix42 wants to merge 10 commits into
easymodo:masterfrom
Buggfix42:better-zoom-qimgv-public

Conversation

@Buggfix42

@Buggfix42 Buggfix42 commented Jul 2, 2026

Copy link
Copy Markdown

Hello there,
I compared many image viewers and found qimgv to be the best, especially because of the huge flexibility with keyboard shortcuts, actions and scripts.
But I also noticed some things that annoyed me, mainly the default zoom every image viewer, qimgv included, provides.
The image viewer IrfanView I used on windows is buggy on linux and provides a very user-friendly zoom (see #659) that qimgv doesn't have.
I couldn't use the default zoom because it was just too annoying, especially that you first had to zoom into the image THEN scroll the image and THEN move the cursor all the way to the edge to zoom into the location you want to inspect. Just annoying.
This lead to me implementing the IrfanView zoom (0b0bfd3).
At the beginning I didn't know anything about Qt and was pretty confused about everything.
But LLMs were a huge help explaining Qt concepts such as the 10 different coordinate systems Qt uses.
Once I got into the code it was quite fun to program in Qt so I also provided a bug fix and a few improvements for myself.

Commit 0b0bfd3
Adds IrfanView zoom. Hover the pixel with the cursor you want to eventually center. Zoom in. The pixel will eventually be centered in the view IF you didn't move the cursor while zooming in.
IrfanView moves the cursor but I decided to not implement that because that is prone to being laggy and buggy.
Also, @easymodo, what about making this the default zoom of qimgv?

Commit b4c5378
See this issue (#626).
It annoyed me so I let a LLM search for the issue and surprisingly it found it.

Commit 822ac9d
When you assign "ESC" to "closeFullscreenOrExit", have a context menu open and press ESC then the application will close instead of closing the context menu.
ESC shouldn't close the application, but pop-up menus like the context menu first before closing the application.

Commit 9ea01f4
I noticed that when I opened the image file with the "showInDirectory" action then the file isn't highlighted in linux mint.
Fixed it, rewrote some code + fixed space path bug.

Commit b7b025d
I noticed a few things in the code that could be improved.
This is almost only stuff that doesn't influence the behavior of the image viewer.

Commit 5694dd7
Also code improvement stuff but placed it in a seperate commit.

Commit 63fab0b
I use the "Lock View" feature in IrfanView frequently but in qimgv it is buggy for images of different sizes (e.g. go into top right corner, switch to next image, view isn't exactly in the top right corner).
I noticed that the code contains a bug (different from the one above) and is inefficient so I rewrote the whole thing from scratch. However, this commit is incomplete in a sense that it adds a setting to the config file but no GUI setting. I tried to edit the settings GUI with QCreator but gave up because the complexity was a bit overwhelming and I'm afraid I'll break something if I really try to add a setting. I planned to add the following GUI setting in the "Zoom options" setting box at the very bottom:

<horizontal seperation line>
Zoom preservation mode:
• Image width      • Image height      • Pixel density
Defines how zoom should be preserved when the preservation mode is activated (see togglePreserve actions) and you switch to another image.

Commit 82808c8
The "Lock zoom" feature is useless as far as I can tell. Maybe I'm just overseeing its usefullness, that's why I put the removal in a seperate commit and not in the previous one.

Commit 359e274
In the settings menu there is a slider next to "Expand images, up to:" where there is an option called "-".
Nobody knows what this does the first time they're seeing this. I also saw somebody in the Issues section requesting the feature that "-" provides.
I rewrote stuff to make it more clear what this "-" does.
Notice that this will change the setting of users for this slider. They'll have to correct it again when they update to a version containing this commit.

Commit ebd0120
I added the word "Maximum" to the translation files.
But I'm not sure if I did it correctly since I'm a Qt beginner, that's why I put it into a seperate commit.
I entered lupdate ~/Desktop/qimgv/ -ts ~/Desktop/qimgv/qimgv/res/translations/* and then added the translation via QLinguist and saved the language files. Is that correct?

PS: I did not use LLMs to do maths or generate code, not even a single line.

Buggfix42 added 10 commits July 2, 2026 13:14
…osing the application in case ESC is selected to close the application.
…ments + fix for file paths containing spaces
The "Lock View" feature was broken for images of different sizes.
Additionally, the code was inefficient and contained a bug, so I completely rewrote it and
splitted the "lockView" feature into "togglePreserveView" (save view the
moment an image switch occurs) and
"togglePreserveCurrentView" (save view only once when action is
triggered).
This feature is useless as far as I can evaluate it.
It restores the view in the top-left corner which can also be done with
the "togglePreserveCurrentView" feature.
It confused me (and others in the "Issues page") what the "-"
was supposed to do as a slider option next to the "Expand images, up to:" label.
Re-ordered the "-" to the very end and renamed it "Maximum".
@Buggfix42

Copy link
Copy Markdown
Author

Here are some satisfying videos about the holy magic of sceneRoundPos(...) (pixel snapping) within the IrfanView zoom action.

without sceneRoundPos, zooming at right border
https://github.com/user-attachments/assets/026bb8e5-d032-4a1d-ac87-8f64cc78a145

without sceneRoundPos, zooming at top-left corner
https://github.com/user-attachments/assets/d5a0aed1-a886-4c48-b4df-aab83f7ac2a7

with sceneRoundPos, zooming at right border
https://github.com/user-attachments/assets/84b3e806-33aa-49de-9f49-3f6718d69fba

with sceneRoundPos, zooming at top-left corner
https://github.com/user-attachments/assets/117ce069-f8f3-43c8-a9ed-491c7ac023a7

Here is the effect of the border collapse mechanism:

without border collapse:
https://github.com/user-attachments/assets/40f1aeb8-98bc-476a-a0e0-1e060e63024f

with border collapse:
https://github.com/user-attachments/assets/731b6ac3-a3df-4c68-91f7-ea31ed47220a

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.

2 participants