summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-10-21 14:09:01 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2014-10-24 08:19:08 +0200
commit624740cdcdd4abfb15bbbc8a8aa056c57712499f (patch)
treea2874c3f5a38d03a26c1ee3b6508c11e7d0e1339 /src/gui
parent2bfee10f3ab8e8e33b2169d735baedcdd9f2b584 (diff)
Fix printing of semitransparent images to PDF
The patch marks the image data to be inverted when a soft mask is used. Without this any embedded image with semitransparent pixels would be decoded with inverted colors. Task-number: QTBUG-31540 Change-Id: Ia607f7c1acf542ecf3bc88d713dfd87785b43f40 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qpdf.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 6ea002a761..1da0c6b65f 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -2083,8 +2083,10 @@ int QPdfEnginePrivate::writeImage(const QByteArray &data, int width, int height,
}
if (maskObject > 0)
xprintf("/Mask %d 0 R\n", maskObject);
- if (softMaskObject > 0)
+ if (softMaskObject > 0) {
xprintf("/SMask %d 0 R\n", softMaskObject);
+ xprintf("/Decode [1 0 1 0 1 0]\n");
+ }
int lenobj = requestObject();
xprintf("/Length %d 0 R\n", lenobj);