Improve picture scaling issues in epub generator

CCBUG: 391625

Test Plan: I tested the file mentioned in the bug report. Pictures look less blurry

Reviewers: #okular

Subscribers: ngraham, aacid, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D13766
This commit is contained in:
Gilbert Assaf 2018-07-28 23:03:20 +02:00 committed by Albert Astals Cid
parent aed8e5ac28
commit 57be655c15

View file

@ -86,9 +86,9 @@ QVariant EpubDocument::loadResource(int type, const QUrl &name)
const int maxHeight = maxContentHeight();
const int maxWidth = maxContentWidth();
if(img.height() > maxHeight)
img = img.scaledToHeight(maxHeight);
img = img.scaledToHeight(maxHeight, Qt::SmoothTransformation);
if(img.width() > maxWidth)
img = img.scaledToWidth(maxWidth);
img = img.scaledToWidth(maxWidth, Qt::SmoothTransformation);
resource.setValue(img);
break;
}