Ruben2776 / PicView

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

Feature: refactor image scaling mode handling #122

Closed nopeless closed 7 months ago

nopeless commented 8 months ago

Resolves #120

Let me know if you need some more features. I put WIP as I believe this needs more discussion

Ruben2776 commented 8 months ago

Hi there, thanks for the PR. I'm afraid I'm not sure what you're trying to accomplish. Setting BitmapScalingMode to NearestNeighbor results in images bigger than the screen resulotion to be visually downgraded.

nopeless commented 8 months ago

Hi there, thanks for the PR. I'm afraid I'm not sure what you're trying to accomplish. Setting BitmapScalingMode to NearestNeighbor results in images bigger than the screen resulotion to be visually downgraded.

I also thought this might be a concern. personally it wasn't really noticeable, but I'll switch aliasing modes on zoom anyway. Thanks for pointing it out

I do a lot of pixel art work, and I need lightweight image viewers. Windows' default viewer doesn't have a configuration to change aliasing modes.

Before image

After image

Ruben2776 commented 8 months ago

I have tried your changes myself, though I've only experienced the image looking worse using it. However, it can be an option in the settings window.

If you want to edit your pull request to make the edits changeable by the user, I will accept it - or I can do the changes myself.

nopeless commented 8 months ago

Sure, a setting would be good enough, where the user can toggle nearest neightbor, as long as its persistent. Anything I can do to help with this?

Ruben2776 commented 7 months ago

Can you confirm if the commit b1342155058d9194cf31be89a660e6713276e36c is what you're referring to, and possibly edit or modify it with the PR if not?

nopeless commented 7 months ago

I'll try to confirm it tomorrow

nopeless commented 7 months ago

Judging from the code, it looks like the feature was implemented properly. I am excited to see this

nopeless commented 7 months ago

@Ruben2776 I am getting crashes on the dev branch. I believe its just a simple mistake. Along with the fix, I also refactored it so that the logic is dealt in a more conventional manner and reduced duplicate code for future refactoring.

nopeless commented 7 months ago

whoops, wrong file

Ruben2776 commented 7 months ago

Thanks. Is there anything else to be added - or otherwise I will merge?

nopeless commented 7 months ago

@Ruben2776 It's good to go. Afaik, the application doesn't have invalid states but please check it and test it yourself as well just in case.