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>
bb10
Allan Sandfeld Jensen 2014-10-21 14:09:01 +02:00 committed by Allan Sandfeld Jensen
parent 2bfee10f3a
commit 624740cdcd
1 changed files with 3 additions and 1 deletions

View File

@ -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);