From 624740cdcdd4abfb15bbbc8a8aa056c57712499f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 21 Oct 2014 14:09:01 +0200 Subject: 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 --- src/gui/painting/qpdf.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3