summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats/jpeg/qjpeghandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/imageformats/jpeg/qjpeghandler.cpp')
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 3b23e56..6b2f885 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -741,7 +741,7 @@ static bool ensureValidImage(QImage *dest, struct jpeg_decompress_struct *info,
*dest = QImage(size, format);
if (format == QImage::Format_Indexed8) {
- dest->setNumColors(256);
+ dest->setColorCount(256);
for (int i = 0; i < 256; i++)
dest->setColor(i, qRgb(i,i,i));
}
@@ -851,7 +851,7 @@ static bool read_jpeg_image(QIODevice *device, QImage *outImage,
} else if (cinfo.output_components == 1) {
if (outImage->size() != QSize(sWidth, sHeight) || outImage->format() != QImage::Format_Indexed8)
*outImage = QImage(sWidth, sHeight, QImage::Format_Indexed8);
- outImage->setNumColors(256);
+ outImage->setColorCount(256);
for (int i = 0; i < 256; ++i)
outImage->setColor(i, qRgb(i,i,i));
} else {
@@ -1054,7 +1054,7 @@ static bool write_jpeg_image(const QImage &sourceImage, QIODevice *device, int s
case QImage::Format_MonoLSB:
case QImage::Format_Indexed8:
gray = true;
- for (int i = image.numColors(); gray && i--;) {
+ for (int i = image.colorCount(); gray && i--;) {
gray = gray & (qRed(cmap[i]) == qGreen(cmap[i]) &&
qRed(cmap[i]) == qBlue(cmap[i]));
}