Bug 338367

Summary: CANVAS : unable to zoom out to less than fit to window [patch]
Product: [Applications] digikam Reporter: falolaf
Component: ImageEditor-CanvasAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version: 4.2.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.6.0
Sentry Crash Report:
Attachments: zoomout.patch
zoomout2.patch
zoomout3.patch
zoomout4.patch
toolpreviewzoom.patch

Description falolaf 2014-08-19 08:26:08 UTC
It's impossible to use 'View->Zoom out' if the images fits to the window. Fit to either width or height doesn't matter. 'View->Zoom out' is grey.

Setting a zoom factor to a smaller value works though.
Comment 1 caulier.gilles 2014-08-19 08:45:33 UTC
Right, reproducible here...

Gilles Caulier
Comment 2 Maik Qualmann 2014-12-05 23:00:40 UTC
Created attachment 89840 [details]
zoomout.patch

This patch fixes the Zoom out problem. By input into the Zoom combo box can be extended to 1% -4800% of the zoom range. By entering a large zoom factor in the Zoom combo box digiKam could crash.
Comment 3 Maik Qualmann 2014-12-06 05:44:32 UTC
Created attachment 89842 [details]
zoomout2.patch
Comment 4 Maik Qualmann 2014-12-06 05:48:11 UTC
The zoomout2.patch corrects a problem if the window is smaller than the current minZoomFactor.
Comment 5 caulier.gilles 2014-12-06 06:28:10 UTC
Thanks Maik For you patches.

I suppose that zoomout2.patch replace zoomout.patch. If yes, please don't forget to set as "obsolete" older one when you push new one in bugzilla.

Gilles Caulier
Comment 6 caulier.gilles 2014-12-06 06:36:50 UTC
Maik,

You patch zoomout2.patch touch SinglePhotoPreviewLayout and DZoomBar classes. Both are used with

1/ Image Editor canvas (relevant of this entry).
2/ Preview canvas from AlbumUI (F3 mode).
3/ Preview canvas from ImportUI (F3 mode).
4/ Preview Canvas from LightTable.

Did you seen if no regression have not been introduced with 2/ 3/ 4/ in canvas zoom management ?

Gilles Caulier
Comment 7 caulier.gilles 2014-12-06 06:45:11 UTC
Maik,

In Light Table, put the same image on Left and Right View. From high values to fit on view zoom level, both view are sync if you press on zoom +/- butom from status bar. If zoom level is lower than fit on view value, only left or right view is zoomed out.

This specific case is certainly relevant of zoom management done in Light Table implementation to sync left and right view, not from your patch.

Gilles Caulier
Comment 8 caulier.gilles 2014-12-06 06:50:32 UTC
Maik,

Else, i tested cases 1/, 2/, and 3/ : no regression introduced.

It still the little problem with Light Table, explained in my comment #7.

Seen in Light Table implementation from lightTableView class, where signals/slots connection are done between preview and zoombar.

Gilles Caulier
Comment 9 Maik Qualmann 2014-12-06 07:59:43 UTC
Gilles,

yes the sync zoom from Light Table do not work correctly. Could the resize event of scrollbars are, I'll be looking at.
Comment 10 Maik Qualmann 2014-12-06 23:42:59 UTC
Created attachment 89847 [details]
zoomout3.patch

New patch for test. Sorry for the large changes in the Light Table. The patch also fixes the problem on the Light Table that is lost synchronization when the image is smaller than the window.
Comment 11 caulier.gilles 2014-12-07 10:43:05 UTC
Git commit be72e5d8c0465ab4b8b441841ae22be47c3dbc92 by Gilles Caulier.
Committed on 07/12/2014 at 10:39.
Pushed by cgilles into branch 'master'.

Apply patch #89847 from Maik Qualmann to permit to zoom out over preview and editor canvas lesser than fit image to window scale.
Adjust Light Table zoom handling signal and slots to run with new preview zoom range
FIXED-IN: 4.6.0

M  +2    -1    NEWS
M  +14   -2    libs/widgets/graphicsview/previewlayout.cpp
M  +1    -1    libs/widgets/mainview/dzoombar.cpp
M  +37   -27   utilities/lighttable/lighttableview.cpp
M  +2    -0    utilities/lighttable/lighttableview.h

http://commits.kde.org/digikam/be72e5d8c0465ab4b8b441841ae22be47c3dbc92
Comment 12 Maik Qualmann 2014-12-08 17:55:06 UTC
Created attachment 89869 [details]
zoomout4.patch

Gilles,

can you please add zoomout4.patch to optimize the code and reset a large zoom range on standard.
Comment 13 caulier.gilles 2014-12-08 18:01:44 UTC
Git commit 2fa15e1d23d25e6522562dec4d00425f0a940e85 by Gilles Caulier.
Committed on 08/12/2014 at 18:00.
Pushed by cgilles into branch 'master'.

apply patch #89869 from Maik Qualmann to optimize zomming code and reset a large zoom range on standard.

M  +9    -12   libs/widgets/graphicsview/previewlayout.cpp

http://commits.kde.org/digikam/2fa15e1d23d25e6522562dec4d00425f0a940e85
Comment 14 Maik Qualmann 2014-12-10 17:26:36 UTC
Created attachment 89908 [details]
toolpreviewzoom.patch

A small correction caused by the new preview zoom range.
This patch fixes a problem in the editor tool face (eg color tools with zoomable preview) when the preview image is smaller than the window there was no updating preview (without scrollContentsBy or resizeEvents).
Comment 15 caulier.gilles 2014-12-10 17:35:35 UTC
Git commit 2d7efd827a8e66cb85d50ab9318af64f6d6f7e3d by Gilles Caulier.
Committed on 10/12/2014 at 17:34.
Pushed by cgilles into branch 'master'.

apply patch #89908 from Maik Qualmaan about to fix editor tool preview zoom range.

M  +3    -0    utilities/imageeditor/editor/editortooliface.cpp

http://commits.kde.org/digikam/2d7efd827a8e66cb85d50ab9318af64f6d6f7e3d