[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2107-g56116e5

[email protected] (Nancy Durgin)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  56116e5ccd376e12353879851bd363f61b5ec104 (commit)
      from  11cb1d747f027ea912419d2580308eb3b3952e6c (commit)

----------------------------------------------------------------------
commit 56116e5ccd376e12353879851bd363f61b5ec104
Author: Nancy Durgin <[email protected]>
Date:   Thu Aug 8 15:02:17 2019 -0700

    Fix previous commit (even though it clustered okay...)
    
    pdfi_get_image_info() gets called in a few more places.  Add some parameters
    to make this cleaner.

diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c
index c619f6c..408d32b 100644
--- a/pdf/pdf_image.c
+++ b/pdf/pdf_image.c
@@ -416,12 +416,17 @@ pdfi_scan_jpxfilter(pdf_context *ctx, pdf_stream *source, int length, pdfi_jpx_i
 
 /* Get image info out of dict into more convenient form, enforcing some requirements from the spec */
 static int
-pdfi_get_image_info(pdf_context *ctx, pdf_dict *image_dict, pdf_dict *page_dict, pdfi_image_info_t *info)
+pdfi_get_image_info(pdf_context *ctx, pdf_dict *image_dict,
+                    pdf_dict *page_dict, pdf_dict *stream_dict, bool inline_image,
+                    pdfi_image_info_t *info)
 {
     int code;
     double temp_f;
 
     memset(info, 0, sizeof(*info));
+    info->page_dict = page_dict;
+    info->stream_dict = stream_dict;
+    info->inline_image = inline_image;
 
     /* Not Handled: "ID", "OPI" */
 
@@ -1058,12 +1063,9 @@ pdfi_do_image(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *stream_dict, pdf_
             return code;
     }
 
-    code = pdfi_get_image_info(ctx, image_dict, page_dict, &image_info);
+    code = pdfi_get_image_info(ctx, image_dict, page_dict, stream_dict, inline_image, &image_info);
     if (code < 0)
         goto cleanupExit;
-    image_info.page_dict = page_dict;
-    image_info.stream_dict = stream_dict;
-    image_info.inline_image = inline_image;
 
     /* If there is an OC dictionary, see if we even need to render this */
     if (image_info.OC) {
@@ -1083,7 +1085,7 @@ pdfi_do_image(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *stream_dict, pdf_
         if (alt_dict != NULL) {
             image_dict = alt_dict;
             pdfi_free_image_info_components(&image_info);
-            code = pdfi_get_image_info(ctx, image_dict, page_dict, &image_info);
+            code = pdfi_get_image_info(ctx, image_dict, page_dict, stream_dict, inline_image, &image_info);
             if (code < 0)
                 goto cleanupExit;
         }
@@ -1108,7 +1110,7 @@ pdfi_do_image(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *stream_dict, pdf_
             mask_array = (pdf_array *)image_info.Mask;
         } else if (image_info.Mask->type == PDF_DICT) {
             mask_dict = (pdf_dict *)image_info.Mask;
-            code = pdfi_get_image_info(ctx, mask_dict, page_dict, &mask_info);
+            code = pdfi_get_image_info(ctx, mask_dict, page_dict, stream_dict, inline_image, &mask_info);
             if (code < 0)
                 goto cleanupExit;
         } else {


Summary of changes:
 pdf/pdf_image.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 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.