From b18df9fc8cd717e43cab87f7b295c4cb2fc39704 Mon Sep 17 00:00:00 2001 From: "Kasper F. Brandt" Date: Tue, 2 Sep 2014 10:53:32 +0200 Subject: [PATCH] Don't act on format of image and then read alpha channel from noneScaled. Fixes wkhtmltopdf/wkhtmltopdf#1638 --- src/gui/painting/qprintengine_pdf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp index 78e6301e584..4988df1510a 100644 --- a/src/gui/painting/qprintengine_pdf.cpp +++ b/src/gui/painting/qprintengine_pdf.cpp @@ -956,7 +956,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, qint64 serial_n bool hasAlpha = false; bool hasMask = false; - if (format != QImage::Format_RGB32) { + if ((!uns && format == QImage::Format_ARGB32) || (uns && noneScaled->format() == QImage::Format_ARGB32)) { softMaskData.resize(w * h); uchar *sdata = (uchar *)softMaskData.data(); for (int y = 0; y < h; ++y) {