Fix image smoothing sometimes not getting applied
ClosedPublic

Authored by rkflx on Jul 21 2018, 10:50 PM.

Details

Summary

In 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 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.

BUG: 396736
FIXED-IN: 18.08.0

Test Plan

Enable Image ViewZoom modeKeep 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.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rkflx requested review of this revision.Jul 21 2018, 10:50 PM
rkflx created this revision.

Refactoring sneak peek (headed for master, will post a Diff once the bug fix landed), which still needs testing and a commit message: P243

ngraham accepted this revision.Jul 22 2018, 1:07 PM
ngraham added a subscriber: ngraham.

Explanation makes sense and the patch works as expected.

This revision is now accepted and ready to land.Jul 22 2018, 1:07 PM

Refactoring sneak peek (headed for master, will post a Diff once the bug fix landed), which still needs testing and a commit message: P243

Patch and refactoring preview looks both good to me, can't find any issue.

But of course noticed another one: While in tool mode (crop, redeye) zooming by mouse wheel does not work.

rkflx added a comment.Jul 23 2018, 7:47 AM

Thanks for the review!

But of course noticed another one: While in tool mode (crop, redeye) zooming by mouse wheel does not work.

You only noticed this now? ;) This has been annoying me ever since testing any of the Crop patches. Unfortunately, in this case I did not yet get around to look into it. Feel free to work on it…

This revision was automatically updated to reflect the committed changes.