qView
qView copied to clipboard
"Original size" bug
Environment:
-
OS: Windows 10 64bit 20H2 19042.685 Display resolution : 3840x2160
-
qView version: 4.0
Information: When system Settings "Display"-"Scale and layout" is above 100%, "Original size" gets incorrect size. So I rolled back to version 3.0.
Can you please demonstrate exactly the behavior you are looking for and how it has changed? Comparison pictures would be helpful.
SAME PNG FILE, SAME "DISPLAY" WINDOW, DEFAULT SETTINGS.
version3
- Open file for the first time, a bit blurry.
- After click "Original Size", very clear.
everything is normal.
version4
- Open file for the first time. Note that in the upper left corner, it's a picture, not my desktop. The 1920X1200 picture almost fills my screen
- After click "Original Size".
just set the system scaling to 150% or 200%, then open a picture and see what happens
This was actually supposed to be intentional, but clearly I need to add an option.
This was actually supposed to be intentional.
Interesting idea, but I've never seen any image viewer that scales images like qView does.
If I have 4K display with 200 % scaling and I download 4K picture and view it fullscreen, I would expect it to be displayed in perfect 1:1 ratio. Since qView scales images, I assume it would blow picture to 8K and then downscale it to 4K and I would loose picture clarity since it would be presented basically in HD.
So thank you for adding this to 5.0 milestone.
Well the original bug report that led me to change it to this behavior argued that it is idiomatic on Mac. On mac, preview.app actually works this way.
Hmm.. Never worked with Mac. Maybe it generates retina image @2...
Anyway, I guess an option would be the best way to go to please everybody.
I have the same issue on linux. when I use kde plasma on wayland and use 200% display setting scaling (integer scaling, as fractional scaling has issues with wayland right now), and try to view a 1080p picture on my 1080p screen, the image get stretched two times. it seems that qview thinks my screen is a 540p screen.
other image viewer dont do this and correctly only use scaling for their UI element.
this behavior caused me to incorrectly assume it was kde fault and report a false bug.
There are two ways this could be expected to work:
- A 1920-wide image on a 3840-wide display is always shown pixel-for-pixel and takes up half of the display's width.
- That same image is adjusted for the display's scaling factor, 1.5 (150%) for example as reported by this issue's author, in which case the image takes up 75% of the display's width.
There is no right way to do it, it's probably best to have a setting for it. Different programs handle it differently; image editors/viewers on Windows typically(?) do # 1, and web browsers do # 2. On macOS it usually only makes sense to do # 2 due to the way macOS handles display scaling - it's often rendering to a virtual desktop larger than the native resolution and scaling down; there's no guarantee that one pixel drawn will equal one pixel on the display.
That said, the specific problem @shu307 was having goes further. If you notice, qView was making the 1920-wide image take up 100% of the display which matches neither of the expected behaviors. This is due to the way Qt handled DPI scaling prior to Qt6. Qt::HighDpiScaleFactorRoundingPolicy defaulted to Round
which results in a 2.0 scale factor when Windows is set to 150% scaling. As of Qt6, the default has been changed to PassThrough
.
So this situation is at least improved in the nightly Win64 builds because they use Qt6 now after @jurplel switched from Azure Pipelines to GitHub Actions. As for the Win32 builds, the same improvement would be possible with a small code change.
I dont know about macOS, but I think the first way is the correct way. if you tell the program to show the image (collection of pixels) at the original size, then it should show pixel to pixel. this way use sees the original image. and scaling rounding and other issues are not present.
I think the same way as I would about a movie. a movie played should play a 1080p movie on a 1080p physical screen pixel to pixel in full screen, regardless of scale. even though mpv in linux right now cant on wayland. scaling in for vectors not for images.
and web browsers do it so that the web layout don't gets messed up. an image or video player doesn't have this issue.
I implemented an option called "Zoom level is relative to screen pixels" in my repo to make 1 image pixel equal 1 screen pixel @ 100% zoom level. Maybe that or something similar could be integrated into the official qView some day. It was a little tricky to get right and handle the window getting dragged across different displays with varying scaling settings or the scaling setting getting changed on the current display, but I think I got it all working.
I implemented an option called "Zoom level is relative to screen pixels" in my repo to make 1 image pixel equal 1 screen pixel @ 100% zoom level. Maybe that or something similar could be integrated into the official qView some day. It was a little tricky to get right and handle the window getting dragged across different displays with varying scaling settings or the scaling setting getting changed on the current display, but I think I got it all working.
I would be interested in a PR with this change + your change for the PassThrough tweak above
Awesome work
I implemented an option called "Zoom level is relative to screen pixels" in my repo to make 1 image pixel equal 1 screen pixel @ 100% zoom level. Maybe that or something similar could be integrated into the official qView some day. It was a little tricky to get right and handle the window getting dragged across different displays with varying scaling settings or the scaling setting getting changed on the current display, but I think I got it all working.
I always thought that was what "%100 size" or "natural size" was. and at least in xorg it is. but in wayland it has issues. my suggestion is to wait for wayland new fractional scaling to work and then implement what you want. if you do it before that you may need some hacks to make it work. although wayland scaling with integer scales also has some issues still.
This fix would be very much appreciated, it's the only big issue keeping me from using qView at the moment, because I need to see the pixel perfect versions of my photos and not a scaled version. Thank you all for your hard work :)