[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2343-g9f40c36

[email protected] (Nancy Durgin) Wed, 30 Oct 2019 19:24:23 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  9f40c369f92326477fa893ddf8b9e869dd3e0052 (commit)
       via  9b02e94a5a6c9154627565ad74118c89e8502472 (commit)
      from  1033ab54d598997b8da16adb57d090fa2eaadf36 (commit)

----------------------------------------------------------------------
commit 9f40c369f92326477fa893ddf8b9e869dd3e0052
Author: Nancy Durgin <[email protected]>
Date:   Wed Oct 30 11:17:49 2019 -0700

    Implement SMaskInData for JPX images
    
    This fixes fts_17_1700.pdf.
    
    Following the way the gs code did it, we create a new SMask dictionary
    and process it like a normal SMask.
    
    Had to do some hacky stuff like supporting the fake "Alpha" parameter
    in the jpxdecode filter implementation.
    
    Also fixed a debug message

diff --git a/pdf/pdf_file.c b/pdf/pdf_file.c
index 5192ef9..554058a 100644
--- a/pdf/pdf_file.c
+++ b/pdf/pdf_file.c
@@ -366,13 +366,22 @@ pdfi_JPX_filter(pdf_context *ctx, pdf_dict *dict, pdf_dict *decode,
     int code;
     pdf_obj *csobj = NULL;
     pdf_name *csname = NULL;
+    bool alpha;
 
     state.memory = ctx->memory->non_gc_memory;
     if (s_jpxd_template.set_defaults)
       (*s_jpxd_template.set_defaults)((stream_state *)&state);
 
     /* Pull some extra params out of the image dict */
-    /* TODO: Alpha -- this seems to be a hack that PS implementation did, need to get equiv */
+    if (dict) {
+        /* This Alpha is a thing that gs code uses to tell that we
+         * are doing an SMask.  It's a bit of a hack, but
+         * I guess we can do the same.
+         */
+        code = pdfi_dict_get_bool(ctx, dict, "Alpha", &alpha);
+        if (code == 0)
+            state.alpha = alpha;
+    }
     if (dict && pdfi_dict_get(ctx, dict, "ColorSpace", &csobj) == 0) {
         /* parse the value */
         if (csobj->type == PDF_ARRAY) {
diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c
index f0c4296..4b0fbd0 100644
--- a/pdf/pdf_image.c
+++ b/pdf/pdf_image.c
@@ -375,8 +375,9 @@ pdfi_scan_jpxfilter(pdf_context *ctx, pdf_stream *source, int length, pdfi_jpx_i
                 info->icc_offset = pdfi_tell(source) - (box_len-3);
                 info->icc_length = box_len - 3;
                 if (ctx->pdfdebug)
-                    dbgmprintf4(ctx->memory, "JPXDecode: COLR Meth 2 at offset %d(0x%x), length %d(0x%x)\n",
-                          info->icc_offset, info->icc_offset, info->icc_length, info->icc_length);
+                    dbgmprintf5(ctx->memory, "JPXDecode: COLR Meth %d at offset %d(0x%x), length %d(0x%x)\n",
+                                cs_meth, info->icc_offset, info->icc_offset,
+                                info->icc_length, info->icc_length);
                 cs_enum = 0;
             } else {
                 if (ctx->pdfdebug)
@@ -1067,6 +1068,70 @@ pdfi_image_get_color(pdf_context *ctx, pdf_stream *source, pdfi_image_info_t *im
     return code;
 }
 
+/* Make a fake SMask dict from a JPX SMaskInData */
+static int
+pdfi_make_smask_dict(pdf_context *ctx, pdf_dict *image_dict, pdfi_image_info_t *image_info)
+{
+    int code;
+    pdf_dict *smask_dict = NULL;
+    pdf_array *array = NULL;
+
+    if (image_info->SMask != NULL) {
+        dmprintf(ctx->memory, "ERROR SMaskInData when there is already an SMask?\n");
+        goto exit;
+    }
+
+    if (image_info->SMaskInData != 1) {
+        dmprintf1(ctx->memory, "Unsupported SMaskInData = %ld\n", image_info->SMaskInData);
+        goto exit;
+    }
+
+    code = pdfi_alloc_object(ctx, PDF_DICT, 32, (pdf_obj **)&smask_dict);
+    if (code < 0) goto exit;
+    pdfi_countup(&smask_dict);
+
+    /* Copy everything from the image_dict */
+    code = pdfi_dict_copy(smask_dict, image_dict);
+    smask_dict->stream_offset = image_dict->stream_offset;
+
+    code = pdfi_dict_put_int(ctx, smask_dict, "SMaskInData", 0);
+    if (code < 0) goto exit;
+
+    code = pdfi_dict_put_name(ctx, smask_dict, "ColorSpace", "DeviceGray");
+    if (code < 0) goto exit;
+
+    /* BPC needs to come from the jpxinfo */
+    code = pdfi_dict_put_int(ctx, smask_dict, "BitsPerComponent", image_info->jpx_info.bpc);
+    if (code < 0) goto exit;
+
+    /* "Alpha" is a non-standard thing that gs code uses to tell
+     * the jpxfilter that it is doing an SMask.  I guess we can do
+     * the same, since we're making this dictionary anyway.
+     */
+    code = pdfi_dict_put_bool(ctx, smask_dict, "Alpha", true);
+    if (code < 0) goto exit;
+
+    /* Make an array [0,1] */
+    code = pdfi_array_alloc(ctx, 2, &array);
+    if (code < 0) goto exit;
+    pdfi_countup(array);
+    code = pdfi_array_put_int(ctx, array, 0, 0);
+    if (code < 0) goto exit;
+    code = pdfi_array_put_int(ctx, array, 1, 1);
+    if (code < 0) goto exit;
+    code = pdfi_dict_put(ctx, smask_dict, "Decode", (pdf_obj *)array);
+    if (code < 0) goto exit;
+
+    image_info->SMask = (pdf_obj *)smask_dict;
+
+ exit:
+    if (code < 0) {
+        pdfi_countdown(smask_dict);
+        pdfi_countdown(array);
+    }
+    return code;
+}
+
 /* NOTE: "source" is the current input stream.
  * on exit:
  *  inline_image = TRUE, stream it will point to after the image data.
@@ -1147,6 +1212,11 @@ pdfi_do_image(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *stream_dict, pdf_
         code = pdfi_scan_jpxfilter(ctx, source, image_info.Length, &image_info.jpx_info);
         if (code < 0)
             goto cleanupExit;
+        if (ctx->page_has_transparency && image_info.SMaskInData != 0) {
+            code = pdfi_make_smask_dict(ctx, image_dict, &image_info);
+            if (code < 0)
+                goto cleanupExit;
+        }
     }
 
     if (ctx->page_has_transparency == true && image_info.SMask != NULL) {

----------------------------------------------------------------------
commit 9b02e94a5a6c9154627565ad74118c89e8502472
Author: Nancy Durgin <[email protected]>
Date:   Wed Oct 30 08:38:17 2019 -0700

    Add convenience routines for array and dict, refactor code
    
    Add routines for inserting things in arrays and dicts.  Refactor some
    of the old code that put things in dicts.
    
    Basically now the name will be created in the routine, instead of by
    the caller.  Things can be inserted into a dict by specifying the
    key as a string instead of having to create an object in the caller.
    
    Some of these new routines will be used by image code that is WIP, or
    at least that's why they were written...

diff --git a/pdf/pdf_array.c b/pdf/pdf_array.c
index 7ed2d6b..b7bb27e 100644
--- a/pdf/pdf_array.c
+++ b/pdf/pdf_array.c
@@ -221,6 +221,19 @@ int pdfi_array_put(pdf_context *ctx, pdf_array *a, uint64_t index, pdf_obj *o)
     return 0;
 }
 
+int pdfi_array_put_int(pdf_context *ctx, pdf_array *a, uint64_t index, int64_t val)
+{
+    int code;
+    pdf_num *obj;
+
+    code = pdfi_alloc_object(ctx, PDF_INT, 0, (pdf_obj **)&obj);
+    obj->value.i = val;
+    if (code < 0)
+        return code;
+
+    return pdfi_array_put(ctx, a, index, (pdf_obj *)obj);
+}
+
 /* Strictly speaking the normalize_rect isn't really part of the PDF array
  * processing, but its very likely that any time we want to use it, the
  * rectangle will have come from a PDF array in a PDF file so it makes
diff --git a/pdf/pdf_array.h b/pdf/pdf_array.h
index e0a3227..253f4b4 100644
--- a/pdf/pdf_array.h
+++ b/pdf/pdf_array.h
@@ -30,6 +30,7 @@ int pdfi_array_get_type(pdf_context *ctx, pdf_array *a, uint64_t index, pdf_obj_
 int pdfi_array_get_int(pdf_context *ctx, pdf_array *a, uint64_t index, int64_t *i);
 int pdfi_array_get_number(pdf_context *ctx, pdf_array *a, uint64_t index, double *f);
 int pdfi_array_put(pdf_context *ctx, pdf_array *a, uint64_t index, pdf_obj *o);
+int pdfi_array_put_int(pdf_context *ctx, pdf_array *a, uint64_t index, int64_t val);
 
 bool pdfi_array_known(pdf_context *ctx, pdf_array *a, pdf_obj *, int *index);
 
diff --git a/pdf/pdf_colour.c b/pdf/pdf_colour.c
index 3d3c0d7..b2a3bac 100644
--- a/pdf/pdf_colour.c
+++ b/pdf/pdf_colour.c
@@ -178,7 +178,7 @@ static int pdfi_check_for_spots_by_array(pdf_context *ctx, pdf_array *color_arra
             if (code < 0)
                 goto exit;
 
-            code = pdfi_dict_put(ctx->SpotNames, name, dummy);
+            code = pdfi_dict_put_obj(ctx->SpotNames, name, dummy);
             pdfi_countdown(name);
             if (code < 0)
                 break;
@@ -206,7 +206,7 @@ static int pdfi_check_for_spots_by_array(pdf_context *ctx, pdf_array *color_arra
         if (code < 0)
             goto exit;
 
-        code = pdfi_dict_put(ctx->SpotNames, (pdf_obj *)space, dummy);
+        code = pdfi_dict_put_obj(ctx->SpotNames, (pdf_obj *)space, dummy);
         *num_spots += 1;
         goto exit;
     } else {
diff --git a/pdf/pdf_dict.c b/pdf/pdf_dict.c
index 9985d0e..e620eb6 100644
--- a/pdf/pdf_dict.c
+++ b/pdf/pdf_dict.c
@@ -529,7 +529,8 @@ int make_int_array_from_dict(pdf_context *ctx, int **parray, pdf_dict *dict, con
     return array_size;
 }
 
-int pdfi_dict_put(pdf_dict *d, pdf_obj *Key, pdf_obj *value)
+/* Put into dictionary with key as object */
+int pdfi_dict_put_obj(pdf_dict *d, pdf_obj *Key, pdf_obj *value)
 {
     uint64_t i;
     pdf_obj **new_keys, **new_values;
@@ -595,12 +596,67 @@ int pdfi_dict_put(pdf_dict *d, pdf_obj *Key, pdf_obj *value)
     return 0;
 }
 
+/* Put into dictionary with key as string */
+int pdfi_dict_put(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj *value)
+{
+    int code;
+    pdf_obj *key = NULL;
+
+    code = pdfi_make_name(ctx, (byte *)Key, strlen(Key), &key);
+    if (code < 0)
+        return code;
+
+    code = pdfi_dict_put_obj(d, key, value);
+    pdfi_countdown(key); /* get rid of extra ref */
+    return code;
+}
+
+int pdfi_dict_put_int(pdf_context *ctx, pdf_dict *d, const char *key, int64_t value)
+{
+    int code;
+    pdf_num *obj;
+
+    code = pdfi_alloc_object(ctx, PDF_INT, 0, (pdf_obj **)&obj);
+    obj->value.i = value;
+    if (code < 0)
+        return code;
+
+    return pdfi_dict_put(ctx, d, key, (pdf_obj *)obj);
+}
+
+int pdfi_dict_put_bool(pdf_context *ctx, pdf_dict *d, const char *key, bool value)
+{
+    int code;
+    pdf_bool *obj = NULL;
+
+    code = pdfi_alloc_object(ctx, PDF_BOOL, 0, (pdf_bool **)&obj);
+    if (code < 0)
+        return code;
+
+    obj->value = value;
+    return pdfi_dict_put(ctx, d, key, (pdf_bool *)obj);
+}
+
+int pdfi_dict_put_name(pdf_context *ctx, pdf_dict *d, const char *key, const char *name)
+{
+    int code;
+    pdf_obj *obj = NULL;
+
+    code = pdfi_make_name(ctx, (byte *)name, strlen(name), &obj);
+    if (code < 0)
+        return code;
+
+    code = pdfi_dict_put(ctx, d, key, obj);
+    pdfi_countdown(obj); /* get rid of extra ref */
+    return code;
+}
+
 int pdfi_dict_copy(pdf_dict *target, pdf_dict *source)
 {
     int i=0, code = 0;
 
     for (i=0;i< source->entries;i++) {
-        code = pdfi_dict_put(target, source->keys[i], source->values[i]);
+        code = pdfi_dict_put_obj(target, source->keys[i], source->values[i]);
         if (code < 0)
             return code;
     }
@@ -763,7 +819,7 @@ int pdfi_merge_dicts(pdf_dict *target, pdf_dict *source)
         if (code < 0)
             return code;
         if (!known) {
-            code = pdfi_dict_put(target, source->keys[i], source->values[i]);
+            code = pdfi_dict_put_obj(target, source->keys[i], source->values[i]);
             if (code < 0)
                 return code;
         }
diff --git a/pdf/pdf_dict.h b/pdf/pdf_dict.h
index 0628b72..58691f3 100644
--- a/pdf/pdf_dict.h
+++ b/pdf/pdf_dict.h
@@ -28,7 +28,11 @@ int pdfi_dict_knownget(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj *
 int pdfi_dict_knownget_type(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj_type type, pdf_obj **o);
 int pdfi_dict_knownget_number(pdf_context *ctx, pdf_dict *d, const char *Key, double *f);
 int pdfi_merge_dicts(pdf_dict *target, pdf_dict *source);
-int pdfi_dict_put(pdf_dict *d, pdf_obj *Key, pdf_obj *value);
+int pdfi_dict_put_obj(pdf_dict *d, pdf_obj *Key, pdf_obj *value);
+int pdfi_dict_put(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj *value);
+int pdfi_dict_put_int(pdf_context *ctx, pdf_dict *d, const char *Key, int64_t value);
+int pdfi_dict_put_bool(pdf_context *ctx, pdf_dict *d, const char *Key, bool value);
+int pdfi_dict_put_name(pdf_context *ctx, pdf_dict *d, const char *Key, const char *name);
 int pdfi_dict_get2(pdf_context *ctx, pdf_dict *d, const char *Key1, const char *Key2, pdf_obj **o);
 int pdfi_dict_get(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj **o);
 int pdfi_dict_get_no_store_R(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj **o);
diff --git a/pdf/pdf_int.c b/pdf/pdf_int.c
index 2835692..6e9b815 100644
--- a/pdf/pdf_int.c
+++ b/pdf/pdf_int.c
@@ -2294,8 +2294,6 @@ int pdfi_read_Root(pdf_context *ctx)
         return code;
 
     if (o1->type == PDF_INDIRECT) {
-        pdf_obj *name;
-
         code = pdfi_dereference(ctx, ((pdf_indirect_ref *)o1)->ref_object_num,  ((pdf_indirect_ref *)o1)->ref_generation_num, &o);
         pdfi_countdown(o1);
         if (code < 0)
@@ -2306,16 +2304,7 @@ int pdfi_read_Root(pdf_context *ctx)
             return_error(gs_error_typecheck);
         }
 
-        code = pdfi_make_name(ctx, (byte *)"Root", 4, &name);
-        if (code < 0) {
-            pdfi_countdown(o);
-            return code;
-        }
-        code = pdfi_dict_put(ctx->Trailer, name, o);
-        /* pdfi_make_name created a name with a reference count of 1, the local object
-         * is going out of scope, so decrement the reference coutn.
-         */
-        pdfi_countdown(name);
+        code = pdfi_dict_put(ctx, ctx->Trailer, "Root", o);
         if (code < 0) {
             pdfi_countdown(o);
             return code;
@@ -2362,8 +2351,6 @@ int pdfi_read_Info(pdf_context *ctx)
         return code;
 
     if (o1->type == PDF_INDIRECT) {
-        pdf_obj *name;
-
         code = pdfi_dereference(ctx, ((pdf_indirect_ref *)o1)->ref_object_num,  ((pdf_indirect_ref *)o1)->ref_generation_num, &o);
         pdfi_countdown(o1);
         if (code < 0)
@@ -2374,16 +2361,7 @@ int pdfi_read_Info(pdf_context *ctx)
             return_error(gs_error_typecheck);
         }
 
-        code = pdfi_make_name(ctx, (byte *)"Info", 4, &name);
-        if (code < 0) {
-            pdfi_countdown(o);
-            return code;
-        }
-        code = pdfi_dict_put(ctx->Trailer, name, o);
-        /* pdfi_make_name created a name with a reference count of 1, the local object
-         * is going out of scope, so decrement the reference coutn.
-         */
-        pdfi_countdown(name);
+        code = pdfi_dict_put(ctx, ctx->Trailer, "Info", o);
         if (code < 0) {
             pdfi_countdown(o);
             return code;
@@ -2419,8 +2397,6 @@ int pdfi_read_Pages(pdf_context *ctx)
         return code;
 
     if (o1->type == PDF_INDIRECT) {
-        pdf_obj *name;
-
         code = pdfi_dereference(ctx, ((pdf_indirect_ref *)o1)->ref_object_num,  ((pdf_indirect_ref *)o1)->ref_generation_num, &o);
         pdfi_countdown(o1);
         if (code < 0)
@@ -2431,16 +2407,7 @@ int pdfi_read_Pages(pdf_context *ctx)
             return_error(gs_error_typecheck);
         }
 
-        code = pdfi_make_name(ctx, (byte *)"Pages", 5, &name);
-        if (code < 0) {
-            pdfi_countdown(o);
-            return code;
-        }
-        code = pdfi_dict_put(ctx->Root, name, o);
-        /* pdfi_make_name created a name with a reference count of 1, the local object
-         * is going out of scope, so decrement the reference coutn.
-         */
-        pdfi_countdown(name);
+        code = pdfi_dict_put(ctx, ctx->Root, "Pages", o);
         if (code < 0) {
             pdfi_countdown(o);
             return code;
@@ -2514,7 +2481,7 @@ pdfi_get_child(pdf_context *ctx, pdf_array *Kids, int i, pdf_dict **pchild)
     pdf_dict *child = NULL;
     pdf_name *Type = NULL;
     pdf_dict *leaf_dict = NULL;
-    pdf_name *Key = NULL, *Key1 = NULL;
+    pdf_name *Key = NULL;
     int code = 0;
 
     code = pdfi_array_get_no_deref(ctx, Kids, i, (pdf_obj **)&node);
@@ -2568,13 +2535,10 @@ pdfi_get_child(pdf_context *ctx, pdf_array *Kids, int i, pdf_dict **pchild)
             code = pdfi_make_name(ctx, (byte *)"PageRef", 7, (pdf_obj **)&Key);
             if (code < 0)
                 goto errorExit;
-            code = pdfi_dict_put(leaf_dict, (pdf_obj *)Key, (pdf_obj *)node);
+            code = pdfi_dict_put_obj(leaf_dict, (pdf_obj *)Key, (pdf_obj *)node);
             if (code < 0)
                 goto errorExit;
-            code = pdfi_make_name(ctx, (byte *)"Type", 4, (pdf_obj **)&Key1);
-            if (code < 0)
-                goto errorExit;
-            code = pdfi_dict_put(leaf_dict, (pdf_obj *)Key1, (pdf_obj *)Key);
+            code = pdfi_dict_put(ctx, leaf_dict, "Type", (pdf_obj *)Key);
             if (code < 0)
                 goto errorExit;
             code = pdfi_array_put(ctx, Kids, i, (pdf_obj *)leaf_dict);
@@ -2594,7 +2558,6 @@ pdfi_get_child(pdf_context *ctx, pdf_array *Kids, int i, pdf_dict **pchild)
     pdfi_countdown(node);
     pdfi_countdown(Type);
     pdfi_countdown(Key);
-    pdfi_countdown(Key1);
     return code;
 }
 
@@ -2604,7 +2567,6 @@ static int
 pdfi_check_inherited_key(pdf_context *ctx, pdf_dict *d, const char *keyname, pdf_dict *inheritable)
 {
     int code = 0;
-    pdf_obj *Key = NULL;
     pdf_obj *object = NULL;
     bool known;
 
@@ -2613,9 +2575,6 @@ pdfi_check_inherited_key(pdf_context *ctx, pdf_dict *d, const char *keyname, pdf
     if (code < 0)
         goto exit;
     if (known) {
-        code = pdfi_make_name(ctx, (byte *)keyname, strlen(keyname), &Key);
-        if (code < 0)
-            goto exit;
         code = pdfi_loop_detector_mark(ctx);
         if (code < 0){
             goto exit;
@@ -2629,11 +2588,10 @@ pdfi_check_inherited_key(pdf_context *ctx, pdf_dict *d, const char *keyname, pdf
         if (code < 0) {
             goto exit;
         }
-        code = pdfi_dict_put(inheritable, Key, object);
+        code = pdfi_dict_put(ctx, inheritable, keyname, object);
     }
 
  exit:
-    pdfi_countdown(Key);
     pdfi_countdown(object);
     return code;
 }
diff --git a/pdf/pdf_trans.c b/pdf/pdf_trans.c
index 4a513a0..c98322b 100644
--- a/pdf/pdf_trans.c
+++ b/pdf/pdf_trans.c
@@ -62,7 +62,6 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
     gs_matrix save_matrix, GroupMat, group_Matrix;
     gs_transparency_mask_subtype_t subtype = TRANSPARENCY_MASK_Luminosity;
     pdf_bool *Processed = NULL;
-    pdf_obj *Key = NULL;
 
     dbgmprintf(ctx->memory, "pdfi_trans_set_mask (.execmaskgroup) BEGIN\n");
     memset(&params, 0, sizeof(params));
@@ -77,18 +76,14 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
     }
     /* If /Processed not in the dict, put it there */
     if (code == 0) {
-        /* the cleanup at end of this routine assumes both Key and Processed have a ref */
+        /* the cleanup at end of this routine assumes Processed has a ref */
         code = pdfi_alloc_object(ctx, PDF_BOOL, 0, (pdf_obj **)&Processed);
         if (code < 0)
             goto exit;
         Processed->value = false;
         /* pdfi_alloc_object() doesn't grab a ref */
         pdfi_countup(Processed);
-        /* pdfi_make_name() does grab a ref, so no need to countup */
-        code = pdfi_make_name(ctx, (byte *)"Processed", strlen("Processed"), &Key);
-        if (code < 0)
-            goto exit;
-        code = pdfi_dict_put(SMask, Key, (pdf_obj *)Processed);
+        code = pdfi_dict_put(ctx, SMask, "Processed", (pdf_obj *)Processed);
         if (code < 0)
             goto exit;
     }
@@ -270,7 +265,6 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
     pdfi_countdown(Matrix);
     pdfi_countdown(CS);
     pdfi_countdown(Processed);
-    pdfi_countdown(Key);
     dbgmprintf(ctx->memory, "pdfi_trans_set_mask (.execmaskgroup) END\n");
     return code;
 }


Summary of changes:
 pdf/pdf_array.c  | 13 ++++++++++
 pdf/pdf_array.h  |  1 +
 pdf/pdf_colour.c |  4 +--
 pdf/pdf_dict.c   | 62 ++++++++++++++++++++++++++++++++++++++++++++---
 pdf/pdf_dict.h   |  6 ++++-
 pdf/pdf_file.c   | 11 ++++++++-
 pdf/pdf_image.c  | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 pdf/pdf_int.c    | 56 ++++++------------------------------------
 pdf/pdf_trans.c  | 10 ++------
 9 files changed, 171 insertions(+), 66 deletions(-)