https://bugs.kde.org/show_bug.cgi?id=434049

            Bug ID: 434049
           Summary: faulty logic in "updateZoomAndSize", zoom level
                    changed after preview image changed
           Product: digikam
           Version: 7.2.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Preview-Image
          Assignee: digikam-bugs-n...@kde.org
          Reporter: oldk1...@gmail.com
  Target Milestone: ---

SUMMARY

I think the logic in "updateZoomAndSize" is faulty and suggest following
change.

The check "(zoomFactor() <= fitZoom)" is unnecessary, it messes up zoom level
when a small image is encountered.

With this patch, the zoom level is fixed when "isFitToWindow" flag is not set.

This patch should also fulfill the need of
https://bugs.kde.org/show_bug.cgi?id=379553

--- a/core/libs/widgets/graphicsview/previewlayout.cpp
+++ b/core/libs/widgets/graphicsview/previewlayout.cpp
@@ -326,7 +326,7 @@ void SinglePhotoPreviewLayout::updateZoomAndSize()

     // Is currently the zoom factor set to fit to window? Then set it again to
fit the new size.

-    if (!d->zoomSettings()->imageSize().isNull() && ((zoomFactor() <= fitZoom)
|| d->isFitToWindow))
+    if (!d->zoomSettings()->imageSize().isNull() && d->isFitToWindow)
     {
         fitToWindow();
     }


STEPS TO REPRODUCE
1. In preview mode, select a big picture, and "Zoom to 100%".
2. Now select a small picture.
3. Select back the big picture.

OBSERVED RESULT

1. Can see part of the big picture, which is expected.
2. Can see the small picture with original size.
3. The big picture is now "fit to window".

EXPECTED RESULT

1. Same, see the big picture with zoom level 100%.
2. Same, see the small picture with zoom level 100%.
3. We should still see the big picture with zoom level 100%.

SOFTWARE/OS VERSIONS
digikam 7.2.0-rc on Linux/Plasma

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to