summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-16 17:04:47 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-18 11:06:00 +0000
commitbee1df1fddc0cdaa646c94c89425402f1997930b (patch)
tree7fd972e13c8eefde064f5ca463414ba558197a26 /src
parent191e8d4985ae4a83878c0b666855757cef824f1f (diff)
Read grayscale JP2000 as grayscale
Return a real grayscale qimage instead of an 8-bit indexed qimage. Change-Id: I6f47bfe4268a675f8ce54f9daed10e94feb9e309 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/imageformats/jp2/qjp2handler.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/plugins/imageformats/jp2/qjp2handler.cpp b/src/plugins/imageformats/jp2/qjp2handler.cpp
index 3fe3b65..8bb791d 100644
--- a/src/plugins/imageformats/jp2/qjp2handler.cpp
+++ b/src/plugins/imageformats/jp2/qjp2handler.cpp
@@ -586,10 +586,7 @@ bool Jpeg2000JasperReader::read(QImage *pImage)
if (hasAlpha) {
qtImage = QImage(qtWidth, qtHeight, QImage::Format_ARGB32);
} else {
- qtImage = QImage(qtWidth, qtHeight, QImage::Format_Indexed8);
- qtImage.setColorCount(256);
- for (int c = 0; c < 256; ++c)
- qtImage.setColor(c, qRgb(c,c,c));
+ qtImage = QImage(qtWidth, qtHeight, QImage::Format_Grayscale8);
}
}