diff options
author | Joni Poikelin <joni.poikelin@theqtcompany.com> | 2015-11-04 11:35:09 +0200 |
---|---|---|
committer | Joni Poikelin <joni.poikelin@theqtcompany.com> | 2015-11-05 05:33:37 +0000 |
commit | d894cfa863a3fc9cd9a6dcb9f3c7b04e6ce41285 (patch) | |
tree | 31239797b00f11d3221f71bafe3aa879386f343d /src/gui/image/qimage.cpp | |
parent | 6ed957fd7fc748143093fa335d8b4506c3ea16fa (diff) |
Fix QImage::setDotsPerMeterX/Y for images with some orientations
Rotation of images with orientation of 90 and 270 degrees dropped DPM
values from rotated image.
Task-number: QTBUG-49220
Change-Id: I9c23153c49dd63b5f6958fdde72f466873b0a407
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r-- | src/gui/image/qimage.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index c4691b5f5e..b3d8563614 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4285,6 +4285,8 @@ QImage QImage::smoothScaled(int w, int h) const { static QImage rotated90(const QImage &image) { QImage out(image.height(), image.width(), image.format()); + out.setDotsPerMeterX(image.dotsPerMeterY()); + out.setDotsPerMeterY(image.dotsPerMeterX()); if (image.colorCount() > 0) out.setColorTable(image.colorTable()); int w = image.width(); @@ -4353,6 +4355,8 @@ static QImage rotated180(const QImage &image) { static QImage rotated270(const QImage &image) { QImage out(image.height(), image.width(), image.format()); + out.setDotsPerMeterX(image.dotsPerMeterY()); + out.setDotsPerMeterY(image.dotsPerMeterX()); if (image.colorCount() > 0) out.setColorTable(image.colorTable()); int w = image.width(); |