summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorMatthew Cattell <matthew.cattell@nokia.com>2011-05-02 11:26:05 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-10 12:54:53 +0200
commitc500291e42ea3f0237418b629d4a0bf9c0f23ff8 (patch)
tree4b22566a70db33a5c831562c7b3658e7edb3a244 /src/gui
parent42452a32bfea29bf8176d19442f6e3c890c2b7e2 (diff)
Fixed bug in QPdfEngine::addImage causing mono images to be made 32 bit
Regression from 4.5 causing performance and size degradation. Task-number: QTBUG-18997 Reviewed-by: Samuel (cherry picked from commit 18122b473ecbd85ba953f70743b1756358bf7c0c)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qprintengine_pdf.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp
index b7f51606da..353869f3a4 100644
--- a/src/gui/painting/qprintengine_pdf.cpp
+++ b/src/gui/painting/qprintengine_pdf.cpp
@@ -534,7 +534,10 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, qint64 serial_n
QImage image = img;
QImage::Format format = image.format();
- if (image.depth() == 1 && *bitmap && img.colorTable().size() == 0) {
+ if (image.depth() == 1 && *bitmap && img.colorTable().size() == 2
+ && img.colorTable().at(0) == QColor(Qt::black).rgba()
+ && img.colorTable().at(1) == QColor(Qt::white).rgba())
+ {
if (format == QImage::Format_MonoLSB)
image = image.convertToFormat(QImage::Format_Mono);
format = QImage::Format_Mono;