Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Original size" bug #374

Open
shu307 opened this issue Dec 14, 2020 · 18 comments · May be fixed by #699
Open

"Original size" bug #374

shu307 opened this issue Dec 14, 2020 · 18 comments · May be fixed by #699
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@shu307
Copy link

shu307 commented Dec 14, 2020

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.

@shu307 shu307 added the bug Something isn't working label Dec 14, 2020
@jurplel
Copy link
Owner

jurplel commented Dec 16, 2020

Can you please demonstrate exactly the behavior you are looking for and how it has changed? Comparison pictures would be helpful.

@shu307
Copy link
Author

shu307 commented Dec 17, 2020

SAME PNG FILE, SAME "DISPLAY" WINDOW, DEFAULT SETTINGS.

version3

  • Open file for the first time, a bit blurry.
    version3-firstopen
  • After click "Original Size", very clear.
    version3-original
    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

version4-firstopen

  • After click "Original Size".
    version4-original

@shu307
Copy link
Author

shu307 commented Dec 17, 2020

just set the system scaling to 150% or 200%, then open a picture and see what happens

@jurplel
Copy link
Owner

jurplel commented Dec 18, 2020

This was actually supposed to be intentional, but clearly I need to add an option.

@jurplel jurplel added the enhancement New feature or request label Dec 18, 2020
@jurplel jurplel added this to the qView 5.0 milestone Dec 18, 2020
@elman22
Copy link

elman22 commented Sep 14, 2021

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.

@jurplel
Copy link
Owner

jurplel commented Sep 14, 2021

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.

@elman22
Copy link

elman22 commented Sep 14, 2021

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.

@jurplel jurplel modified the milestones: qView 5.0, qView 6.0 Dec 27, 2021
@rezad1393
Copy link

rezad1393 commented May 27, 2022

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.

@jdpurcell
Copy link
Contributor

jdpurcell commented Dec 31, 2022

There are two ways this could be expected to work:

  1. A 1920-wide image on a 3840-wide display is always shown pixel-for-pixel and takes up half of the display's width.
  2. 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.

@rezad1393
Copy link

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.

@jdpurcell
Copy link
Contributor

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.

@jurplel
Copy link
Owner

jurplel commented Jan 11, 2023

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

@rezad1393
Copy link

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.

@ghost
Copy link

ghost commented Nov 2, 2023

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 :)

@jdpurcell jdpurcell linked a pull request Jul 6, 2024 that will close this issue
@WildByDesign
Copy link

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.

This would be an important settings in qView, without a doubt. Please consider this.

All images on Windows at Original size are blurry for anyone using higher DPI scaling. I assume that this is a non-issue for anyone with their Windows scaling set to 100%. However, at 125%, 150%, etc. you are not seeing the image as you should.

When you open the same images in GIMP or other image viewers, the images are not stretched at original size.

qView seems to stretch images in the same way that web browsers do and it just makes them all blurry at original size.

Anyway, I see that PR from @jdpurcell that fixes this issue. Thank you.

I'm going to build from that PR for now and use that until it is merged. Cheers!

@gopgnz
Copy link

gopgnz commented Dec 21, 2024

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.

Please consider releasing this as a new version. I love qView but now that I'm using a 4k screen the images are indeed scaled up beyond their actual resolution. So even viewing the original size is blow up slightly and appears blurrier. I would love to have the option to view pixel 1:1. Sadly I have no experience how to build an installer myself from PR.

@jdpurcell
Copy link
Contributor

@gopgnz This repo thankfully has automated builds, the Windows build from the latest run of my PR #699 is here. If you're curious how to find those links in the future, if you go to my PR and scroll near the bottom where it says "All checks have passed" and click "Show all checks". Then click Details for any one of them, and near the top left click Summary. At the bottom of that summary page are the download links for the automated build.

@gopgnz
Copy link

gopgnz commented Dec 21, 2024

@jdpurcell Thanks a lot! Especially for the quick reply! I just tested it and it works exactly like I hoped. Now the images are viewed at the exact scale. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants