diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2022-03-14 10:54:18 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-03-14 13:31:38 +0000 |
commit | 842864b8546e6fc1350e25b81f3115c678f255b2 (patch) | |
tree | 390dd836cf4e84663f7aa87bedb177072e381e50 | |
parent | 600726eac7a5a58ae96873166e6a37e3afa040fa (diff) | |
download | ghostpdl-842864b8546e6fc1350e25b81f3115c678f255b2.tar.gz |
pdfwrite - reorder operations to get gstate written correctly
Bug #705037 "Blend Mode lost on writing PDF file"
The problem here was soft masks. pdf_update_alpha() deals with a change
in soft mask in addition to writing the alpha values. But we were
writing the Blend Mode without reference to the soft mask.
By calling pdf_update_alpha() before we deal with the blend mode we
will correctly handle soft masks (and any required alpha changes), and
then end up with the blend mode correct as well.
This shows one diff with the test file /tests_private/comparefiles/Bug690534.pdf
The differences are very subtle but I think they are progressions.
-rw-r--r-- | devices/vector/gdevpdfg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/devices/vector/gdevpdfg.c b/devices/vector/gdevpdfg.c index a955e457e..d61712b08 100644 --- a/devices/vector/gdevpdfg.c +++ b/devices/vector/gdevpdfg.c @@ -2942,6 +2942,9 @@ pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs, int bottom; if (pdev->CompatibilityLevel >= 1.4) { + code = pdf_update_alpha(pdev, pgs, ppres, for_text); + if (code < 0) + return code; if (pdev->state.blend_mode != pgs->blend_mode) { static const char *const bm_names[] = { GS_BLEND_MODE_NAMES }; char buf[20]; @@ -2956,9 +2959,6 @@ pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs, return code; pdev->state.blend_mode = pgs->blend_mode; } - code = pdf_update_alpha(pdev, pgs, ppres, for_text); - if (code < 0) - return code; } else { /* * If the graphics state calls for any transparency functions, |