Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Review comment fixes
  • Loading branch information
Marko Mattila committed May 24, 2013
1 parent 501d3b4 commit 3f2aecd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/imageoperation.cpp
Expand Up @@ -226,7 +226,6 @@ QString ImageOperation::scaleImageToSize(const QString &sourceFile, quint64 targ
QFileInfo f(sourceFile);
quint64 originalSize = f.size();
if (originalSize <= targetSize) {
qWarning() << Q_FUNC_INFO << "Target size can not be larger than the original size!";
return QString();
}

Expand Down Expand Up @@ -264,7 +263,7 @@ QString ImageOperation::scaleImageToSize(const QString &sourceFile, quint64 targ
qreal r = w / (h * 1.0); // Aspect ratio
qreal a = originalSize / (w * h * 1.0); // The magic number, which combines depth and compression

quint32 newWidth = qSqrt((targetSize * r) / a);
qint32 newWidth = qSqrt((targetSize * r) / a);
QImage scaled = tmpImage.scaledToWidth(newWidth, Qt::SmoothTransformation);

if (!scaled.save(tmpFile)) {
Expand Down

0 comments on commit 3f2aecd

Please sign in to comment.