[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2329-gf5167ab
[email protected] (Nancy Durgin) Wed, 9 Oct 2019 19:27:22 +0000 (UTC)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, pdfi has been updated
via f5167ab6086e59f7aa344d90cfcceb83d4df9902 (commit)
from 149407471e5b7f95dbf4510e53ee2e21cd85b91f (commit)
----------------------------------------------------------------------
commit f5167ab6086e59f7aa344d90cfcceb83d4df9902
Author: Nancy Durgin <[email protected]>
Date: Wed Oct 9 10:07:22 2019 -0700
Fixes to transparency -- overprint groups and cleanups
pdf_gstate.c
These are to make the code better match the gs code. May not make
much difference (one sample changed, maybe) but it's cleaner and
avoids doing a bunch of unnecessary work.
- Make op_Q check for too many Q before doing transparency stuff
- Do a pdfi_trans_end_smask_notify() after clearing out smask for /None
pdf_trans.c
Fix logic for group in trans_setup.
I had missed the logic here: always start group if there is an SMask.
Fixes Bug690534.pdf and a bunch of others (only in certain device
spaces such as pkmraw).
diff --git a/pdf/pdf_gstate.c b/pdf/pdf_gstate.c
index 9e8d106..535aeb2 100644
--- a/pdf/pdf_gstate.c
+++ b/pdf/pdf_gstate.c
@@ -28,6 +28,7 @@
#include "pdf_pattern.h"
#include "pdf_font.h"
#include "pdf_pattern.h"
+#include "pdf_trans.h"
#include "gsmatrix.h"
#include "gslparam.h"
@@ -196,6 +197,12 @@ int pdfi_op_Q(pdf_context *ctx)
int code;
dbgmprintf(ctx->memory, "(doing Q)\n"); /* TODO: Spammy, delete me at some point */
+ if (ctx->pgs->level <= ctx->current_stream_save.gsave_level) {
+ /* We don't throw an error here, we just ignore it and continue */
+ ctx->pdf_warnings |= W_PDF_TOOMANYQ;
+ dbgmprintf(ctx->memory, "WARNING: Too many q/Q (too many Q's) -- ignoring Q\n");
+ return 0;
+ }
if (ctx->page_has_transparency)
code = gs_pop_transparency_state(ctx->pgs, false);
@@ -1124,8 +1131,10 @@ static int GS_SMask(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_d
pdf_name *n = (pdf_name *)o;
if (pdfi_name_is(n, "None")) {
- if (igs->SMask)
+ if (igs->SMask) {
pdfi_gstate_smask_free(igs);
+ code = pdfi_trans_end_smask_notify(ctx);
+ }
goto exit;
}
code = pdfi_find_resource(ctx, (unsigned char *)"ExtGState", n, stream_dict, page_dict, &o);
diff --git a/pdf/pdf_trans.c b/pdf/pdf_trans.c
index 32dab15..4a513a0 100644
--- a/pdf/pdf_trans.c
+++ b/pdf/pdf_trans.c
@@ -65,6 +65,7 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
pdf_obj *Key = NULL;
dbgmprintf(ctx->memory, "pdfi_trans_set_mask (.execmaskgroup) BEGIN\n");
+ memset(¶ms, 0, sizeof(params));
/* Following the logic of the ps code, cram a /Processed key in the SMask dict to
* track whether it's already been processed.
@@ -562,6 +563,7 @@ int pdfi_trans_setup(pdf_context *ctx, pdfi_trans_state_t *state,
} else {
need_group = false;
}
+ need_group = need_group || (igs->SMask != NULL);
} else {
if (caller == TRANSPARENCY_Caller_Image || igs->SMask == NULL)
need_group = false;
@@ -569,7 +571,6 @@ int pdfi_trans_setup(pdf_context *ctx, pdfi_trans_state_t *state,
need_group = true;
}
-
code = pdfi_trans_set_params(ctx, alpha);
if (code != 0)
return 0;
Summary of changes:
pdf/pdf_gstate.c | 11 ++++++++++-
pdf/pdf_trans.c | 3 ++-
2 files changed, 12 insertions(+), 2 deletions(-)