Ruben2776 / PicView

Fast, free and customizable image viewer for Windows 10 and 11.
https://picview.org
Other
995 stars 66 forks source link

Images not centered #47

Closed vivadavid closed 9 months ago

vivadavid commented 2 years ago

Hi, I used PicView for the first time yesterday and I've noticed that images are not displayed centered.

Normally the image is placed on the left side of the screen, at a certain distance from the top:

PicView 1

In some cases, the image is placed on the top:

PicView 2

Occasionally, the image is cut out:

PicView 3

My preference would be for the images to be displayed both horizontally and vertically centered, but it would be nice if other options were available for users. For example, it might be useful to display the images justified to the top left, as this way the first pixel of each image would be exactly at the same position.

I hope you find this feedback useful to you. Thanks and keep up the good work!

Ruben2776 commented 2 years ago

Hi there, thanks for reaching out.

The issue is caused because you've set the scaling in Windows settings to a value other than 100%, which caused the calculations to be different.

To remedy this issue, you can turn off the Stay Centered options in the settings window, by pressing F4 .

I'll try and code in a solution that supports when Windows scaling is increased in the next release.

If you want the window to be at a certain position, just drag it around while holding Shift and set the Auto fit window off by pressing 3

vivadavid commented 2 years ago

Thank you for your quick reply!

You were right: my screen is rescaled.

  1. I turned off "Keep window centered", but more images were cut out.
  2. As for "Auto Fit", images get unnecessarily resized because they are smaller than the screen resolution.
vivadavid commented 2 years ago

If you don't mind me comparing PicView with other programmes, I was expecting a behaviour similar to the one you find in QuickLook, where all images are horizontally and vertically centered. You may want to have a look at it, as it's a great programme to preview all kinds of formats:

https://github.com/QL-Win/QuickLook

Ruben2776 commented 2 years ago

It does keep things centered if you have default settings in PicView and set scaling to 100% in Windows settings though.

As for images getting cut out, I can't reproduce that.

I'm not sure what you mean by images getting unnecessarily resized because they are smaller than the screen resolution. The lowest size they can be resized to is the image resolution, if it's lower than your screen resolution.

vivadavid commented 2 years ago

What I mean is that all the images displayed earlier on my PC (with Auto Fit off) were small enough to fit the screen, and yet some were being resized to make them smaller.

It might be related to the reescale issue, so I'll wait for a future release. Thanks!

Ruben2776 commented 2 years ago

Could I have you give this one a try and see if it fixes it? https://sourceforge.net/projects/picview/files/PicView%20dpi%20center%20test.zip/download

vivadavid commented 2 years ago

Hi! Despite "Keep window centered" being on, images usually stay on the left of the screen and are occasionally cut out.

I think it works the same as in the previous version, but I'll try to test it again when it's not so late and I'm a bit more focused.

vivadavid commented 2 years ago

Hi, again! I thought the best thing would be to record a video

https://user-images.githubusercontent.com/9334287/135530108-cc25f1e9-3e5b-447c-9e32-8ee1d5f4a204.mp4

.

Ruben2776 commented 2 years ago

Hi again, thanks for the video.

The issue is caused by the Windows operating system using its own algorithm on top of my coded in DPI settings. I remember it worked in an earlier version, but I think Windows updates might have caused the issue. Not entirely sure how to fix it with programming.

A solution you could use would be to right click PicView.exe in the file explorer and tick the override high DPI scaling tickbox as illustrated in pic: image

The application itself is DPI-aware to an extent, so it will still resize itself appropriately to your screen. I'll try to see if I can figure something out so this is not needed.

vivadavid commented 2 years ago

Hi! I've changed the settings and it worked! Thanks!

vivadavid commented 2 years ago

Hello, @Ruben2776,

I've just tested version 1.5 and the problem seems to be fixed. Thanks!

Ruben2776 commented 2 years ago

Hi David, thanks for testing and letting me know.


From: David @.> Sent: Sunday, October 10, 2021 11:25:40 AM To: Ruben2776/PicView @.> Cc: Ruben2776 @.>; Mention @.> Subject: Re: [Ruben2776/PicView] Images not centered (#47)

Hello, @Ruben2776https://github.com/Ruben2776,

I've just tested version 1.5 and the problem seems to be fixed. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Ruben2776/PicView/issues/47#issuecomment-939438232, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABABPY5RJYKE2BJMAAEYXHTUGFLZJANCNFSM5FBYOGQQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.