Changeset View
Changeset View
Standalone View
Standalone View
generators/epub/epubdocument.cpp
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 71 | { | |||
---|---|---|---|---|---|
81 | 81 | | |||
82 | if (data) { | 82 | if (data) { | ||
83 | switch(type) { | 83 | switch(type) { | ||
84 | case QTextDocument::ImageResource:{ | 84 | case QTextDocument::ImageResource:{ | ||
85 | QImage img = QImage::fromData((unsigned char *)data, size); | 85 | QImage img = QImage::fromData((unsigned char *)data, size); | ||
86 | const int maxHeight = maxContentHeight(); | 86 | const int maxHeight = maxContentHeight(); | ||
87 | const int maxWidth = maxContentWidth(); | 87 | const int maxWidth = maxContentWidth(); | ||
88 | if(img.height() > maxHeight) | 88 | if(img.height() > maxHeight) | ||
89 | img = img.scaledToHeight(maxHeight); | 89 | img = img.scaledToHeight(maxHeight, Qt::SmoothTransformation); | ||
90 | if(img.width() > maxWidth) | 90 | if(img.width() > maxWidth) | ||
91 | img = img.scaledToWidth(maxWidth); | 91 | img = img.scaledToWidth(maxWidth, Qt::SmoothTransformation); | ||
92 | resource.setValue(img); | 92 | resource.setValue(img); | ||
93 | break; | 93 | break; | ||
94 | } | 94 | } | ||
95 | case QTextDocument::StyleSheetResource: { | 95 | case QTextDocument::StyleSheetResource: { | ||
96 | QString css = QString::fromUtf8(data); | 96 | QString css = QString::fromUtf8(data); | ||
97 | checkCSS(css); | 97 | checkCSS(css); | ||
98 | resource.setValue(css); | 98 | resource.setValue(css); | ||
99 | break; | 99 | break; | ||
Show All 27 Lines |