Bug 396736

Summary: no antialiasing applied before first zoom change
Product: [Applications] gwenview Reporter: Misha Aizatulin <avatar>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: avatar, null
Priority: NOR    
Version: 18.04.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 18.08.0
Attachments: fix I did for myself

Description Misha Aizatulin 2018-07-21 16:56:58 UTC
Created attachment 114053 [details]
fix I did for myself

If I navigate to a new image outside of zoomToFit and zoomToFill modes, the image is not antialiased. If I then zoom in and out, it becomes antialiased. 

Attached patch solved the problem for me.
Comment 1 null 2018-07-21 22:55:48 UTC
Thanks for the report, I can confirm the issue.

Your initial investigation has been really helpful, saving us time in finding the cause. You are touching the right spot, but calling all of AbstractImageView::setZoom is not necessary, it will be enough to call RasterImageView::onZoomChanged, which will then set the appropriate transformation mode for image smoothing.

Diff: https://phabricator.kde.org/D14269
Comment 2 null 2018-07-24 06:04:01 UTC
Git commit 1ce062a458b1eb653d9827480e1eb826236b58dc by Henrik Fehlauer.
Committed on 24/07/2018 at 06:03.
Pushed by rkflx into branch 'Applications/18.08'.

Fix image smoothing sometimes not getting applied

Summary:
In {nav View} mode, smoothing is applied for scaling up raster images up
to 400%. In general this works fine, but in some cases the smoothing
becomes visible only after zooming manually.

This is due to defaulting to `Qt::FastTransformation` and switching to
`Qt::SmoothTransformation` only for changes in the zoom level and for
the {nav Fit/Fill} zoom modes, but not when the zoom level is unchanged
when navigating to an image.

The issue can be fixed by calling `onZoomChanged`, which not only calls
`updateBuffer` as before, but also `setTransformationMode`.
FIXED-IN: 18.08.0

Test Plan:
Enable {nav Image View > Zoom mode > Keep same zoom and position}, zoom
in to a zoom level just below 400% and switch to the next image.
Smoothing should be applied immediately, without having to zoom in and
out again.

Reviewers: #gwenview, ngraham

Reviewed By: #gwenview, ngraham

Subscribers: muhlenpfordt, ngraham

Differential Revision: https://phabricator.kde.org/D14269

M  +1    -1    lib/documentview/rasterimageview.cpp

https://commits.kde.org/gwenview/1ce062a458b1eb653d9827480e1eb826236b58dc