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
remotes/origin/Applications/18.08
Gilbert Assaf 8 years ago committed by Albert Astals Cid
parent aed8e5ac28
commit 57be655c15
  1. 4
      generators/epub/epubdocument.cpp

@ -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;
}

Loading…
Cancel
Save