Bug 244564 - "Zoom to Fit" does not work on large screens or with most images
Summary: "Zoom to Fit" does not work on large screens or with most images
Status: RESOLVED WORKSFORME
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 2.3
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2010-07-14 04:15 UTC by Mats Ahlgren
Modified: 2018-10-27 04:10 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mats Ahlgren 2010-07-14 04:15:30 UTC
Version:           2.3 (using KDE 4.3.5) 
OS:                Linux

"Zoom to Fit" does not work on large screens
It will only shrink the image if it is larger than the window.
If one is dealing with many small images, or one has a large screen, the feature is completely useless.

Reproducible: Always

Steps to Reproduce:
Use gwenview to browse a bunch of images with less resolution than your screen. "Zoom to Fit" should be enabled in the View menu.

Actual Results:  
The images remain small.

Expected Results:  
The images should scale to match the screen size without overshooting the screen bounds.

Seems trivial to fix; I have gone ahead and provided the algorithm to properly compute image dimensions under "Zoom to Fit" mode, and it probably works for all cases? untested:

imageSlope = imageHeight/imageWidth
displaySlope = displayAreaHeight/displayAreaWidth
if imageSlope > displaySlope:   # image will hit top/bottom before sides
  zoom = displayAreaHeight/imageHeight
  newImageDimensions = {width:imageWidth*zoom, height:displayAreaHeight}
else:   # image will hit sides before top/bottom
  zoom = displayAreaWidth/imageWidth
  newImageDimensions = {width:displayAreaWidth, height:imageHeight*zoom}
Comment 1 Jonathan M Davis 2012-05-23 07:27:19 UTC
This is still an issue with gwenview 2.8.3 on KDE 4.8.3. Zoom to fit never actually zooms in to fit. It just zooms out to fit. So, it never zooms in on smaller images, and there's no way to go through a set of smaller images and have them zoomed in as far as you can without cropping any of the image. This makes it very hard to view smaller images.
Comment 2 Jonathan M Davis 2012-05-23 07:37:40 UTC
Actually, it looks like there's a menu option that fixes this. If you go to "Settings"->"Configure Gwenview" and select "Image View", there's a checkbox labeled "Enlarge Smaller Images." If that's checked, then the smaller images are properly enlarged. Why this isn't the default, I don't know, since I have no idea why you'd want any other behavior, but at least there's a way to enable it.
Comment 3 Benni Hill 2013-04-12 15:21:02 UTC
*** Bug 295554 has been marked as a duplicate of this bug. ***
Comment 4 Benni Hill 2013-06-04 20:48:18 UTC
Can I mark this as fixed?
Comment 5 Andrew Crouthamel 2018-09-24 02:19:35 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Andrew Crouthamel 2018-10-27 04:10:22 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!