[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2203-g3f7cee6

[email protected] (Nancy Durgin)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  3f7cee638937ff9388643aa99ceb0123415d7b3c (commit)
       via  c0eb27613d32bd919da3a923c326df6fa0f4833c (commit)
      from  c6aca0db1566705920766c94a821a4fa08c7ea23 (commit)

----------------------------------------------------------------------
commit 3f7cee638937ff9388643aa99ceb0123415d7b3c
Author: Nancy Durgin <[email protected]>
Date:   Thu Sep 5 15:11:37 2019 -0700

    Change filladjust to 0.3
    
    It is being set twice.  First time it was correct at 0.3, second
    time it was being overridden to 0.  Not sure why the second one is
    even there, but it appears it should be 0.3.
    
    This is going to generate a gazillion diffs, but should be a really good
    change. Some of my test samples that looked correct, but didn't bmpcmp
    with the gs version, now bmpcmp exactly!

diff --git a/pdf/pdftop.c b/pdf/pdftop.c
index 09ef5c6..eb56227 100644
--- a/pdf/pdftop.c
+++ b/pdf/pdftop.c
@@ -179,7 +179,8 @@ pdf_impl_set_device(pl_interp_implementation_t *impl, gx_device *pdevice)
 //        return code;
 
     gs_setaccuratecurves(ctx->pgs, true); /* NB not sure */
-    gs_setfilladjust(ctx->pgs, 0, 0);
+    /* Not sure if we should do this at all here, but it seems it should be .3, not 0 */
+    gs_setfilladjust(ctx->pgs, .3, .3);
 
     gs_setscanconverter(ctx->pgs, pl_main_get_scanconverter(ctx->memory));
 

----------------------------------------------------------------------
commit c0eb27613d32bd919da3a923c326df6fa0f4833c
Author: Nancy Durgin <[email protected]>
Date:   Thu Sep 5 14:40:35 2019 -0700

    Fix bug with transparency groups that was introduced a while ago
    
    It was calling the wrong end_group and doing an extra grestore
    
    Also renamed functions to make it less likely this mistake will happen
    again...

diff --git a/pdf/pdf_path.c b/pdf/pdf_path.c
index 936f065..8c65750 100644
--- a/pdf/pdf_path.c
+++ b/pdf/pdf_path.c
@@ -410,17 +410,15 @@ static int pdfi_B_inner(pdf_context *ctx, bool use_eofill)
     if (ctx->TextBlockDepth != 0)
         ctx->pdf_warnings |= W_PDF_OPINVALIDINTEXT;
 
-#if 1
     if (ctx->page_has_transparency) {
         code = gs_setopacityalpha(ctx->pgs, 1.0);
         if (code < 0)
             return code;
-        code = pdfi_trans_begin_group(ctx, true, true, true);
+        code = pdfi_trans_begin_simple_group(ctx, true, true, true);
         if (code < 0)
             return code;
         started_group = true;
     }
-#endif
 
     code = pdfi_gsave(ctx);
     if (code < 0)
diff --git a/pdf/pdf_trans.c b/pdf/pdf_trans.c
index 91d361b..aaed952 100644
--- a/pdf/pdf_trans.c
+++ b/pdf/pdf_trans.c
@@ -255,7 +255,7 @@ static int pdfi_transparency_group_common(pdf_context *ctx, pdf_dict *page_dict,
     return gs_begin_transparency_group(ctx->pgs, &params, (const gs_rect *)bbox, group_type);
 }
 
-int pdfi_trans_begin_group(pdf_context *ctx, bool stroked_bbox, bool isolated, bool knockout)
+int pdfi_trans_begin_simple_group(pdf_context *ctx, bool stroked_bbox, bool isolated, bool knockout)
 {
     gs_transparency_group_params_t params;
     gs_rect bbox;
@@ -352,7 +352,7 @@ int pdfi_trans_end_group(pdf_context *ctx)
     return code;
 }
 
-/* Ends group with no grestore (needs a better name, but whatever) */
+/* Ends group with no grestore */
 int pdfi_trans_end_simple_group(pdf_context *ctx)
 {
     int code;
@@ -511,7 +511,7 @@ int pdfi_trans_setup(pdf_context *ctx, pdfi_trans_state_t *state,
     /* TODO: error handling... */
     if (need_group) {
         stroked_bbox = (caller == TRANSPARENCY_Caller_Stroke);
-        code = pdfi_trans_begin_group(ctx, stroked_bbox, true, false);
+        code = pdfi_trans_begin_simple_group(ctx, stroked_bbox, true, false);
         state->GroupPushed = true;
         state->saveOA = gs_currentopacityalpha(ctx->pgs);
         state->saveSA = gs_currentshapealpha(ctx->pgs);
@@ -534,7 +534,7 @@ int pdfi_trans_teardown(pdf_context *ctx, pdfi_trans_state_t *state)
         return 0;
 
     if (state->GroupPushed) {
-        code = pdfi_trans_end_group(ctx);
+        code = pdfi_trans_end_simple_group(ctx);
         code = gs_setopacityalpha(ctx->pgs, state->saveOA);
         code = gs_setshapealpha(ctx->pgs, state->saveSA);
     }
diff --git a/pdf/pdf_trans.h b/pdf/pdf_trans.h
index ced5cda..4a63414 100644
--- a/pdf/pdf_trans.h
+++ b/pdf/pdf_trans.h
@@ -37,7 +37,7 @@ int pdfi_trans_setup(pdf_context *ctx, pdfi_trans_state_t *state, pdfi_transpare
                      double alpha);
 int pdfi_trans_teardown(pdf_context *ctx, pdfi_trans_state_t *state);
 
-int pdfi_trans_begin_group(pdf_context *ctx, bool stroked_bbox, bool isolated, bool knockout);
+int pdfi_trans_begin_simple_group(pdf_context *ctx, bool stroked_bbox, bool isolated, bool knockout);
 int pdfi_trans_begin_page_group(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *group_dict);
 int pdfi_trans_begin_form_group(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *form_dict);
 int pdfi_trans_end_group(pdf_context *ctx);


Summary of changes:
 pdf/pdf_path.c  | 4 +---
 pdf/pdf_trans.c | 8 ++++----
 pdf/pdf_trans.h | 2 +-
 pdf/pdftop.c    | 3 ++-
 4 files changed, 8 insertions(+), 9 deletions(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.