[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1561-g368bc91

[email protected] (Ken Sharp)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  368bc91bf0bba66f31204e1ee57da7c9b70b32bb (commit)
       via  9a871de445eaed295748a3b489e138e87b9e0b65 (commit)
      from  1ca2c331684ca2912c431771d1aac8bc5cb42e76 (commit)

----------------------------------------------------------------------
commit 368bc91bf0bba66f31204e1ee57da7c9b70b32bb
Author: Ken Sharp <[email protected]>
Date:   Fri Aug 9 15:57:54 2019 +0100

    pdfwrite - fix a minor error
    
    I don't think this causes any actual problems, but the correct return
    should be 0, not an error, when we can't find a Pattern resource.

diff --git a/devices/vector/gdevpdfi.c b/devices/vector/gdevpdfi.c
index 6e8d238..d095622 100644
--- a/devices/vector/gdevpdfi.c
+++ b/devices/vector/gdevpdfi.c
@@ -2584,7 +2584,7 @@ gdev_pdf_dev_spec_op(gx_device *pdev1, int dev_spec_op, void *data, int size)
         case gxdso_pattern_load:
             pres = pdf_find_resource_by_gs_id(pdev, resourcePattern, id);
             if (pres == 0)
-	      return_error(gs_error_undefined);
+                return 0;
             pres = pdf_substitute_pattern(pres);
             pres->where_used |= pdev->used_mask;
             code = pdf_add_resource(pdev, pdev->substream_Resources, "/Pattern", pres);

----------------------------------------------------------------------
commit 9a871de445eaed295748a3b489e138e87b9e0b65
Author: Ken Sharp <[email protected]>
Date:   Fri Aug 9 15:56:45 2019 +0100

    Transparency compositor - forward unhandled special_ops to target device
    
    Noticed while doing earlier work. The pdf14 device only passed on a few
    specific gxdso_ special_op types to the target device, the remainder
    were sent to the default handler. This seems wrong and caused problems
    for my new gxdso at the time. Instead of it going through the pdf14
    device and ending up at pdfwrite (or the default handler for other
    devices) it was always going to the default handler and never making
    it to pdfwrite when rendering transparency.
    
    The pdf14 device should instead handle any gxdso_ special_ops that vary
    depending on rendering. For instance the JPEG passthrough should *not*
    be passed to the target device, the pdf14 device needs to have the
    uncompressed image data to render it to the compositor buffer.
    
    This commit adds handlers for such gxdso_ special ops, and passes all
    the remaining unhandled ones to the target device for processing.
    
    For some reason this causes diffs in halftones, I have no idea why. but
    they don't seem like problems.

diff --git a/base/gdevp14.c b/base/gdevp14.c
index ac2e708..90b5298 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -6438,20 +6438,28 @@ pdf14_dev_spec_op(gx_device *pdev, int dev_spec_op,
             return 0;
         }
     }
-    /* This code seems wrong to everyone. Why do we pass certain specific spec_ops to the
-     * target device, and not all of them ? This should be regarded as a FIXME and I'll
-     * look into it as time permits. For now, add gxdso_warning_trigger to the list of
-     * spec_ops we pass on.
-     */
-    if (dev_spec_op == gxdso_get_dev_param || dev_spec_op == gxdso_restrict_bbox
-        || dev_spec_op == gxdso_current_output_device || dev_spec_op == gxdso_event_info) {
-        return dev_proc(p14dev->target, dev_spec_op)(p14dev->target, dev_spec_op, data, size);
-    }
     if (dev_spec_op == gxdso_is_encoding_direct)
         return 1;
 
-    return gx_default_dev_spec_op(pdev, dev_spec_op, data, size);
+    /* We don't want to pass on these spec_ops either, because the child might respond
+     * with an inappropriate response when the PDF14 device is active. For example; the
+     * JPEG passthrough will give utterly wrong results if we pass that to a device which
+     * supports JPEG passthrough, because the pdf14 device needs to render the image.
+     */
+    if (dev_spec_op == gxdso_in_pattern_accumulator)
+        return 0;
+    if (dev_spec_op == gxdso_copy_color_is_fast)
+        return 0;
+    if(dev_spec_op == gxdso_pattern_handles_clip_path)
+        return 0;
+    if(dev_spec_op == gxdso_supports_hlcolor)
+        return 0;
+    if(dev_spec_op == gxdso_pattern_can_accum)
+        return 0;
+    if(dev_spec_op == gxdso_JPEG_passthrough_query)
+        return 0;
 
+     return dev_proc(p14dev->target, dev_spec_op)(p14dev->target, dev_spec_op, data, size);
 }
 
 /* Needed to set color monitoring in the target device's profile */
diff --git a/base/gxdevsop.h b/base/gxdevsop.h
index 2302b73..2d4d1a9 100644
--- a/base/gxdevsop.h
+++ b/base/gxdevsop.h
@@ -314,7 +314,7 @@ enum {
      * device.   In this case, we may want to not use the alternate tint
      * tranform even if the blending color space is RGB or Gray. */
     gxdso_pdf14_sep_device,
-    /* Used only by pdfwrite to paa a Form Appearance Name, so that
+    /* Used only by pdfwrite to pass a Form Appearance Name, so that
      * we can use the name in a pdfmark.
      */
     gxdso_pdf_form_name,
@@ -342,18 +342,22 @@ enum {
      * 0 otherwise.
      */
     gxdso_is_encoding_direct,
+    /* gxdso_event_info:
+     *     data = dev_param_req_t
+     *     size = sizeof(dev_param-req_t
+     * Passes a single name in request->Param, naming the event which occurred.
+     * Used to send a warning to pdfwrite that some event has happened we want to know about.
+     * Currently this is used in pdf_font.ps to signal that a substittue font has been
+     * used. If we are emitting PDF/A then we need to abort it, as the Widths array of
+     * the PDF font may not match the widths of the glyphs in the font.
+     */
+    gxdso_event_info,
 
     /* Debug only dsos follow here */
 #ifdef DEBUG
     /* Private dso used to check that a printer device properly forwards to the default */
     gxdso_debug_printer_check,
 #endif
-    /* Used to send a warning to pdfwrite that some event has happened we want to know about.
-     * Currently this is used in pdf_font.ps to signal that a substittue font has been
-     * used. If we are emitting PDF/A then we need to abort it, as the Widths array of
-     * the PDF font may not match the widths of the glyphs in the font.
-     */
-    gxdso_event_info,
     /* Add new gxdso_ keys above this. */
     gxdso_pattern__LAST
 };


Summary of changes:
 base/gdevp14.c            | 28 ++++++++++++++++++----------
 base/gxdevsop.h           | 18 +++++++++++-------
 devices/vector/gdevpdfi.c |  2 +-
 3 files changed, 30 insertions(+), 18 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.