Bug 487613 - Fit to Window in Preview does not scale up smaller images
Summary: Fit to Window in Preview does not scale up smaller images
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Preview-Image (other bugs)
Version First Reported In: 8.4.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-27 06:39 UTC by Roland
Modified: 2024-11-25 19:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 8.4.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland 2024-05-27 06:39:50 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY
While there are aspects of the Fit To Window option (for Preview) that seem to work, some dont, and some behave in ways that make no sense (and are inconsistent with mainstream image viewers- Faststone, ACDSee, Windows Photos, the Adobe products I have, etc). 

STEPS TO REPRODUCE
With a higher-resolution monitor (I run 2600x1900), images that are smaller than some value (in the case being reported, an image that is 272 x 299 pixels) is not affected at all by fit to window. Larger files (I dont know the cutoff) seem to scale up OK, and images larger than the display area seem to scale down properly. Ironically, in Thumbnail mode with scaling set to 100%, the thumbnail of this image is significantly larger on screen than is the preview of the file... 

As for the other weirdness- if you mouse-wheel zoom in to force this image to scale up, now sequential images ignore the fit-to-window config option- zoom is retained; it seems that by manually zooming to bypass this problem, you cause the fit-to-window setting to disable. 

OBSERVED RESULT
As outlined in the steps-to-reproduce

EXPECTED RESULT
There is no case in a library where you would want this non-scaling to happen if fit-to-window is enabled, where it remains possible to override that default scaling via manual zoom modes. 

If you have an icon etc that is blown out by the upscale, and you zoom out to get a better idea of actual display, that doesnt imply anything about other images. If fit-to-window is enabled, that should persist with an image change during browsing a library. If it isnt desired, then the user should simply disable the mode. 

Perhaps, if there was real need, there could be a flag in the image or thumbnail database that persists the last zoom mode, where if it is 0, that means default to system setting, and if it is some positive value, that would represent the last value the user selected as a custom zoom for that image etc. So, at least then, if the user has a mix of images and icons etc, the system would remember any manual zoom applied to a particular image. Maybe a keypress restores that to 100% to save time after manual zoom ops.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2024-05-27 07:25:04 UTC
digiKam has an option in the settings under View to scale smaller images to the view.
This option has not been around for that long and has a long history of discussion. But with this option everyone can decide for themselves whether they want to upscale small images.

Maik
Comment 2 caulier.gilles 2024-05-27 07:28:27 UTC
See he online doc : https://docs.digikam.org/en/setup_application/views_settings.html#preview-settings
Comment 3 Roland 2024-05-27 07:39:10 UTC
I understand that. The problem is, it doesnt work as it should. If you for any reason alter the zoom in a preview, the mode is disabled. Yes, the secondary setting for 'scale smaller images' does seem to resolve part of the report (thank you for that info), but I would maintain that there is no reason the fit-to-window mode should be disabled if the user wants to zoom in or out on a given preview. That isnt consistent with the configuration setting (Fit to Window), and it isnt consistent with the way other image viewers I have used (those mentioned, and others) work. And perhaps there is a 'persist zoom disable' or some other config somewhere, but by default, I would suggest that if a user selects fit to window, and also enables 'scale smaller images',' that is that they want for the default zoom on each new image loaded- as they scroll through an album etc. And at least on 8.4.0, it seems that any alteration of zoom- even one that takes a given image to 90% and then back to 100%, disables the mode.

Best
R
Comment 4 Maik Qualmann 2024-05-27 07:54:06 UTC
Of course, fit to Window is deactivated if you change the zoom. Because you then want to compare images at a certain point by switch back and forth the image. You then have to press the fit to Window button again. This behavior is definitely desired and it doesn't matter how other image viewers behave.

Maik