diff options
author | aavit <eirik.aavitsland@digia.com> | 2014-07-01 11:06:01 +0200 |
---|---|---|
committer | aavit <eirik.aavitsland@digia.com> | 2014-07-01 11:25:15 +0200 |
commit | 85e621e3ecf449bb0587bd4da97ca66179b24f31 (patch) | |
tree | f0a78c9dfd20c850bd0111c5811d6647324e3394 /src | |
parent | 3b24bce1d7147e18a997e2792352e8213522230d (diff) |
Fix DDS image writing
The code did not correctly do the 90-degree rotation needed for DDS,
and would fail on non-square images.
Task-number: QTBUG-39899
Change-Id: I1599e3fe44ff7895db8aa6e325fa8fdba2106694
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/imageformats/dds/qddshandler.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/imageformats/dds/qddshandler.cpp b/src/plugins/imageformats/dds/qddshandler.cpp index 13bb9aa..d5c8793 100644 --- a/src/plugins/imageformats/dds/qddshandler.cpp +++ b/src/plugins/imageformats/dds/qddshandler.cpp @@ -1338,9 +1338,9 @@ bool QDDSHandler::write(const QImage &outImage) dds.pixelFormat.bBitMask = 0x000000ff; s << dds; - for (int width = 0; width < image.width(); width++) { - for (int height = 0; height < image.height(); height++) { - QRgb pixel = image.pixel(height, width);; + for (int height = 0; height < image.height(); height++) { + for (int width = 0; width < image.width(); width++) { + QRgb pixel = image.pixel(width, height); quint32 color; quint8 alpha = qAlpha(pixel); quint8 red = qRed(pixel); |