[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2206-gae75a06

[email protected] (Nancy Durgin)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  ae75a069aa5436603b606f67150c4f1fd769ead1 (commit)
       via  50000eda4d0f6e7ce41d7cc3d3ff5e57c036bf08 (commit)
      from  5ff646360d8410908ac24c578aebc7fec0647a87 (commit)

----------------------------------------------------------------------
commit ae75a069aa5436603b606f67150c4f1fd769ead1
Author: Nancy Durgin <[email protected]>
Date:   Tue Sep 10 12:36:02 2019 -0700

    remove extraneous pdfi_trans_set_params() call
    
    pdfi_trans_setup() will do a pdfi_trans_set_params() anyway
    (Should have no visible effects)

diff --git a/pdf/pdf_path.c b/pdf/pdf_path.c
index 8c65750..6059035 100644
--- a/pdf/pdf_path.c
+++ b/pdf/pdf_path.c
@@ -438,9 +438,6 @@ static int pdfi_B_inner(pdf_context *ctx, bool use_eofill)
     if (code < 0)
         goto exit;
 
-    code = pdfi_trans_set_params(ctx, gs_getstrokeconstantalpha(ctx->pgs));
-    if (code < 0)
-        goto exit;
     code = pdfi_trans_setup(ctx, &state, TRANSPARENCY_Caller_Stroke, gs_getstrokeconstantalpha(ctx->pgs));
     if (code >= 0)
         code = gs_stroke(ctx->pgs);

----------------------------------------------------------------------
commit 50000eda4d0f6e7ce41d7cc3d3ff5e57c036bf08
Author: Nancy Durgin <[email protected]>
Date:   Tue Sep 10 12:35:07 2019 -0700

    Cleanup pdfi_shading() error handling
    
    In preparation for adding transparency.
    This commit should have no effect on execution.

diff --git a/pdf/pdf_shading.c b/pdf/pdf_shading.c
index 890656d..2fb3557 100644
--- a/pdf/pdf_shading.c
+++ b/pdf/pdf_shading.c
@@ -699,7 +699,7 @@ int pdfi_shading(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
 {
     int code, code1;
     pdf_name *n = NULL;
-    pdf_obj *o;
+    pdf_obj *o = NULL;
     gs_shading_t *psh = NULL;
     gs_offset_t savedoffset;
 
@@ -709,52 +709,44 @@ int pdfi_shading(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
     if (ctx->TextBlockDepth != 0)
         ctx->pdf_warnings |= W_PDF_OPINVALIDINTEXT;
 
-    savedoffset = pdfi_tell(ctx->main_stream);
-    code = pdfi_loop_detector_mark(ctx);
-    if (code < 0)
-        return code;
-
-    code = pdfi_gsave(ctx);
-    if (code < 0)
-        return code;
-
     n = (pdf_name *)ctx->stack_top[-1];
-    if (n->type != PDF_NAME) {
-        code = gs_error_typecheck;
-        goto shading_error;
-    }
+    if (n->type != PDF_NAME)
+        return_error(gs_error_typecheck);
+
+    savedoffset = pdfi_tell(ctx->main_stream);
+    code = pdfi_loop_detector_mark(ctx);
+    if (code < 0)
+        return code;
+
+    code = pdfi_gsave(ctx);
+    if (code < 0)
+        goto exit1;
 
     code = pdfi_find_resource(ctx, (unsigned char *)"Shading", n, stream_dict, page_dict, &o);
     if (code < 0)
-        goto shading_error;
+        goto exit2;
 
     if (o->type != PDF_DICT) {
-        code = gs_error_typecheck;
-        goto shading_error;
+        code = gs_note_error(gs_error_typecheck);
+        goto exit2;
     }
 
     code = pdfi_shading_build(ctx, stream_dict, page_dict, (pdf_dict *)o, &psh);
-    pdfi_countdown(o);
-    pdfi_pop(ctx, 1);
-    (void)pdfi_loop_detector_cleartomark(ctx);
+    if (code < 0)
+        goto exit2;
 
-    if (code >= 0) {
-        code = gs_shfill(ctx->pgs, psh);
-    }
-
-    code1 = pdfi_grestore(ctx);
+    code = gs_shfill(ctx->pgs, psh);
 
     if (psh) {
         pdfi_shading_free(ctx, psh);
     }
 
-    pdfi_seek(ctx, ctx->main_stream, savedoffset, SEEK_SET);
-    if (code1 == 0)
-        return code;
-    return code1;
-
-shading_error:
+ exit2:
+    pdfi_countdown(o);
     code1 = pdfi_grestore(ctx);
+    if (code == 0)
+        code = code1;
+ exit1:
     pdfi_pop(ctx, 1);
     (void)pdfi_loop_detector_cleartomark(ctx);
     pdfi_seek(ctx, ctx->main_stream, savedoffset, SEEK_SET);


Summary of changes:
 pdf/pdf_path.c    |  3 ---
 pdf/pdf_shading.c | 42 +++++++++++++++++-------------------------
 2 files changed, 17 insertions(+), 28 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.