Commit 6ce5ccb0 authored by Nate Graham's avatar Nate Graham
Browse files

Merge branch 'release/19.12'

parents 14b962f2 fdd5ecc3
......@@ -404,4 +404,8 @@
<provides>
<binary>gwenview</binary>
</provides>
<releases>
<release version="19.12.1" date="2020-01-09"/>
<release version="19.12.0" date="2019-12-12"/>
</releases>
</component>
......@@ -588,16 +588,18 @@ QImage JpegContent::thumbnail() const
const long prevHeight = it->toLong(0);
const long prevWidth = it->toLong(1);
const double scale = prevWidth / image.width();
// the embedded thumb only needs to be cropped vertically
const long validThumbAreaHeight = ceil(prevHeight / scale);
const long totalHeightOfBlackArea = image.height() - validThumbAreaHeight;
// black bars on top and bottom should be equal in height
const long offsetFromTop = totalHeightOfBlackArea / 2;
const QRect validArea(QPoint(0, offsetFromTop), QSize(image.width(), validThumbAreaHeight));
image = image.copy(validArea);
if (image.width() > 0 && prevWidth > 0 ) {
const double scale = prevWidth / image.width();
// the embedded thumb only needs to be cropped vertically
const long validThumbAreaHeight = ceil(prevHeight / scale);
const long totalHeightOfBlackArea = image.height() - validThumbAreaHeight;
// black bars on top and bottom should be equal in height
const long offsetFromTop = totalHeightOfBlackArea / 2;
const QRect validArea(QPoint(0, offsetFromTop), QSize(image.width(), validThumbAreaHeight));
image = image.copy(validArea);
}
}
}
......
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