Commit b5e4e830 authored by Alexander Volkov's avatar Alexander Volkov

Don't upscale jpeg images when creating thumbnails

BUG: 379817
REVIEW: 130129
parent d0842dc5
......@@ -43,9 +43,10 @@ bool JpegCreator::create(const QString &path, int width, int height, QImage &ima
QImageReader imageReader(path);
const QSize imageSize = imageReader.size();
const QSize thumbnailSize = imageSize.isValid() ? imageSize.scaled(width, height, Qt::KeepAspectRatio)
: QSize(width, height);
imageReader.setScaledSize(thumbnailSize); // fast downscaling
if (imageSize.isValid() && (imageSize.width() > width || imageSize.height() > height)) {
const QSize thumbnailSize = imageSize.scaled(width, height, Qt::KeepAspectRatio);
imageReader.setScaledSize(thumbnailSize); // fast downscaling
}
imageReader.setQuality(0);
JpegCreatorSettings* settings = JpegCreatorSettings::self();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment