[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2219-g700a2c2

[email protected] (Ken Sharp) Sat, 28 Sep 2019 09:42:43 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  700a2c215890f9e82f0db5a1ead1acab8512db79 (commit)
      from  9a1417ebead7b788f6fb060f07e6d56e570fcf36 (commit)

----------------------------------------------------------------------
commit 700a2c215890f9e82f0db5a1ead1acab8512db79
Author: Ken Sharp <[email protected]>
Date:   Sat Sep 28 10:42:34 2019 +0100

    When creating (but not setting) a device colour space, call the
    'install' method. For the device spaces this will result in the colour
    space becoming an ICC space, and getting the appropriate ICC colour
    information attached.

diff --git a/pdf/pdf_colour.c b/pdf/pdf_colour.c
index 9e0b008..0e2780c 100644
--- a/pdf/pdf_colour.c
+++ b/pdf/pdf_colour.c
@@ -1909,6 +1909,13 @@ static int pdfi_create_DeviceGray(pdf_context *ctx, gs_color_space **ppcs)
         *ppcs = gs_cspace_new_DeviceGray(ctx->memory);
         if (*ppcs == NULL)
             code = gs_note_error(gs_error_VMerror);
+        else {
+            code = ((gs_color_space *)*ppcs)->type->install_cspace(*ppcs, ctx->pgs);
+            if (code < 0) {
+                rc_decrement_only_cs(*ppcs, "pdfi_create_DeviceGray");
+                *ppcs = NULL;
+            }
+        }
     } else {
         code = pdfi_gs_setgray(ctx, 1);
     }
@@ -1923,6 +1930,13 @@ static int pdfi_create_DeviceRGB(pdf_context *ctx, gs_color_space **ppcs)
         *ppcs = gs_cspace_new_DeviceRGB(ctx->memory);
         if (*ppcs == NULL)
             code = gs_note_error(gs_error_VMerror);
+        else {
+            code = ((gs_color_space *)*ppcs)->type->install_cspace(*ppcs, ctx->pgs);
+            if (code < 0) {
+                rc_decrement_only_cs(*ppcs, "pdfi_create_DeviceRGB");
+                *ppcs = NULL;
+            }
+        }
     } else {
         code = pdfi_gs_setrgbcolor(ctx, 0, 0, 0);
     }
@@ -1937,6 +1951,13 @@ static int pdfi_create_DeviceCMYK(pdf_context *ctx, gs_color_space **ppcs)
         *ppcs = gs_cspace_new_DeviceCMYK(ctx->memory);
         if (*ppcs == NULL)
             code = gs_note_error(gs_error_VMerror);
+        else {
+            code = ((gs_color_space *)*ppcs)->type->install_cspace(*ppcs, ctx->pgs);
+            if (code < 0) {
+                rc_decrement_only_cs(*ppcs, "pdfi_create_DeviceCMYK");
+                *ppcs = NULL;
+            }
+        }
     } else {
         code = pdfi_gs_setcmykcolor(ctx, 0, 0, 0, 1);
     }


Summary of changes:
 pdf/pdf_colour.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)