summaryrefslogtreecommitdiff
path: root/pdf/pdf_trans.c
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2021-09-14 15:49:11 +0100
committerKen Sharp <ken.sharp@artifex.com>2021-09-14 19:25:25 +0100
commit4b49da41787dce704a582b77068fa7db0a0ac944 (patch)
tree341532af9c168cfec1f21c95c70b021dc63b88b6 /pdf/pdf_trans.c
parent665921352b7c74351b058db6eadda7075583174b (diff)
downloadghostpdl-4b49da41787dce704a582b77068fa7db0a0ac944.tar.gz
GhostPDF - SMask with Matte needs the image colour space for the group
When we encounter an image with an SMask we must push an Isolated group to render the image. If the SMask image has a /Matte entry, then we need to push the group with the colour space of the image. Since the image code is the only client for the transparency routine pdfi_trans_begin_isolated_group() it's simples to make that routine take an additional parameter which is the colour space to be used for the group, or NULL if none. We can then directly use the passed in colour space to set the params ColorSpace member for the group. To facilitate determining whether an image SMask has a Matte or not, its convenient to modify pdfi_image_get_matte() to return a boolean indicating that. This was in fact already being used for that purpose (pdfi_image_setup_type3x) by checking the return value was positive, but I think it's more obvious to have the function update a specific boolean parameter. This is propagated back through pdfi_do_image_smask() for the benefit of pdfi_do_image(). This fixes 4 files: tests_private/pdf/PDF_1.7_FTS/fts_26_2605.pdf tests_private/pdf/uploads/bug700571.pdf These 2 files only exhibited a problem with psddcmyk16 for some reason. tests_private/pdf/sumatra/uninitialized_value_with_JPX_images.pdf tests_private/pdf/PDF_1.7_FTS/fts_17_1718.pdf
Diffstat (limited to 'pdf/pdf_trans.c')
-rw-r--r--pdf/pdf_trans.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pdf/pdf_trans.c b/pdf/pdf_trans.c
index 12047c325..93ab8a6c0 100644
--- a/pdf/pdf_trans.c
+++ b/pdf/pdf_trans.c
@@ -526,14 +526,14 @@ int pdfi_trans_end_simple_group(pdf_context *ctx)
}
-int pdfi_trans_begin_isolated_group(pdf_context *ctx, bool image_with_SMask)
+int pdfi_trans_begin_isolated_group(pdf_context *ctx, bool image_with_SMask, gs_color_space *pcs)
{
gs_transparency_group_params_t params;
gs_rect bbox;
gs_trans_group_params_init(&params, 1.0);
- params.ColorSpace = NULL;
+ params.ColorSpace = pcs;
params.Isolated = true;
params.Knockout = false;
params.image_with_SMask = image_with_SMask;