~ubuntu-branches/ubuntu/vivid/ghostscript/vivid-updates

« back to all changes in this revision

Viewing changes to base/gsicc_cache.c

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2014-05-02 15:48:44 UTC
  • mfrom: (1.1.43)
  • Revision ID: package-import@ubuntu.com-20140502154844-c401rxx0cce8gm0q
Tags: 9.14~dfsg-0ubuntu1
* New upstream release
   - Ghostscript 9.14
   - pdfwrite now uses the same color management engine as Ghostscript
     rendering devices (by default LCMS2). This provides much better
     control over color conversion and color management generally, but
     will result in some small color differences when compared to the
     old system.
     It is no longer necessary to specify UseCIEColor (and we very much
     encourage you not to do this) or the ProcessColorModel if you want
     to convert a PDF file to a specific color space, simply set the
     ColorConversionStrategy appropriately.
     We do not expect any major problems to arise with this new code,
     but for the duration of this release a new switch -dPDFUseOldCMS
     is available which will restore the old color management. See:
     Color Conversion and Management
     Please note that due to constraints of the PDF/A-1 specification,
     the new color management does not yet apply when producing PDF/A
     files.
   - A new device 'eps2write' has been added which allows for the
     creation of EPS files using the ps2write device instead of the old
     (deprecated and removed) pswrite device. This produces
     considerably better quality EPS files than the old epswrite device
     which is now also deprecated and will be removed in a future
     release.
   - ps2write now has a feature to allow customisation of the output
     for specific devices. Please see PSDocOptions and PSPageOptions
     described in ps2ps2.htm Additional Distiller Params
   - Ghostscript now reduces memory usage when processing PDF files
     that use transparency and output is to display devices such as
     Windows display or x11 (i.e. devices that are strictly full
     framebuffer devices), and to high level vector devices that cannot
     reproduce the PDF transparency model, such as the ps2write device
     or pdfwrite when 'flattening' to PDF 1.3 or earlier
     (-dCompatibilityLevel=1.3). This uses banding (clist) files to
     render the transparent areas in bands to reduce memory use, and
     unlike the existing page level banding, this is hidden from the
     target device.
   - Ghostscript can now collect information for pages in temp files
     (in Ghostscript's clist format), then render and output pages for
     the job in arbitrary order, including normal, reverse, odd, even,
     or any order or subset of the pages. This is controlled with the
     --saved-page=___ option. (Note that this only applies to rendering
     devices, and not high level devices such as pdfwrite and
     ps2write.) See: Deferred Page Rendering
   - The Ghostscript device architecture has been extended so that,
     when rendering bands into multiple threads, it is now possible to
     perform post-processing in multiple threads, such as downscale,
     post-render halftoning, or compression. Previously, post
     processing was only possible in the single main thread. This can
     improve performance significantly.
   - Ghostscript has a new "pwgraster" output device for PWG Raster
     output
   - The CUPS device now has improved support for PPD-less printing
   - Plus the usual round of bug fixes, compatibility changes, and
     incremental improvements.
* debian/patches/020140502-0ccf329-fix-fpng-device-build-handle-shared-zlib.patch:
  Fix fpng device build handle for shared zlib (Upstream bug #695113).
* debian/patches/020130903-5ae4180-ps-interpreter-dont-interpolate-imagemask-data-for-high-level-devices.patch,
  debian/patches/020131023-ad3e3ed-handle-type-0-font-in-annotation.patch,
  debian/patches/020131127-87a7fd8-cups-pwg-raster-output-ppd-less-support.patch,
  debian/patches/020131218-5ddd13e-ps2write-dont-emit-a-page-size-change-if-the-last-request-failed.patch,
  debian/patches/020131219-d997bc4-pwgraster-output-device.patch,
  debian/patches/020140313-095ae57-ps2write-fix-missing-beginresource-comment-for-fontfile-objects.patch,
  debian/patches/020140313-5d6b18a-set-correct-portrait-landscape-orientation-on-pcl-5ce.patch,
  debian/patches/020140313-6498483-ps2write-fix-a-dsc-comment.patch,
  debian/patches/020140428-f4584b0-skip-unsupported-font-files.patch:
  Removed patches backported from upstream.
* debian/patches/020140324-b780ff0-protection-against-pxl-segfault-with-image-data-without-colorspace-info.patch,
  debian/patches/020140331-4b44b41-pxlcolor-support-jpeg-in-output.patch,
  debian/patches/020140331-41ab485-pxl-transform-deep-images-with-icc-transform-to-emit-high-level-images.patch,
  debian/patches/1002_pxl-make-dicctransform-default.patch: Refreshed with
  quilt.
* debian/symbols.common: Updated for new upstream source. Applied patch
  which dpkg-gensymbols generated for debian/libgs9.symbols to this file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
481
481
    } else {
482
482
        dev = dev_in;
483
483
    }
484
 
    if ( input_colorspace->cmm_icc_profile_data == NULL ) {
485
 
        /* Use default type */
486
 
        gs_input_profile = gsicc_get_gscs_profile(input_colorspace, pis->icc_manager);
 
484
    if (input_colorspace->cmm_icc_profile_data == NULL) {
 
485
        if (input_colorspace->icc_equivalent != NULL) {
 
486
            gs_input_profile = input_colorspace->icc_equivalent->cmm_icc_profile_data;        
 
487
        } else {
 
488
            /* Use default type */
 
489
            gs_input_profile = gsicc_get_gscs_profile(input_colorspace, 
 
490
                                                      pis->icc_manager);
 
491
        }
487
492
    } else {
488
493
        gs_input_profile = input_colorspace->cmm_icc_profile_data;
489
494
    }
713
718
    cmm_profile_t *devlink_profile = NULL;
714
719
    bool src_dev_link = gs_input_profile->isdevlink;
715
720
    bool pageneutralcolor = false;
 
721
    int cms_flags = 0;
716
722
 
717
723
    /* Determine if we are using a soft proof or device link profile */
718
724
    if (dev != NULL ) {
762
768
        gs_input_profile->buffer == NULL &&
763
769
        gs_input_profile->dev != NULL) {
764
770
 
765
 
        /* ICC profile should be in clist. This is
766
 
        the first call to it.  Note that the profiles are not
767
 
        really shared amongst threads like the links are.  Hence
768
 
        the memory is for the local thread's chunk */
 
771
        /* ICC profile should be in clist. This is the first call to it.  Note that 
 
772
           the profiles are not really shared amongst threads like the links are.  
 
773
           Hence the memory is for the local thread's chunk */
769
774
        cms_input_profile =
770
775
            gsicc_get_profile_handle_clist(gs_input_profile,
771
776
                                           gs_input_profile->memory);
813
818
 
814
819
    /* Now compute the link contents */
815
820
    cms_input_profile = gs_input_profile->profile_handle;
 
821
    /*  Check if the source was generated from a PS CIE color space.  If yes, 
 
822
        then we need to make sure that the CMM does not do something like 
 
823
        force a white point mapping like lcms does */
 
824
    if (gsicc_profile_from_ps(gs_input_profile)) {
 
825
        cms_flags = cms_flags | gscms_avoid_white_fix_flag(); 
 
826
    } 
816
827
    if (cms_input_profile == NULL) {
817
828
        if (gs_input_profile->buffer != NULL) {
818
829
            cms_input_profile =
935
946
            icc_manager->smask_profiles->smask_gray->profile_handle;
936
947
        cms_output_profile = 
937
948
            icc_manager->graytok_profile->profile_handle;
 
949
        /* Turn off bp compensation in this case as there is a bug in lcms */
 
950
        rendering_params->black_point_comp = false;
 
951
        cms_flags = 0;  /* Turn off any flag setting */
938
952
    }
939
953
    /* Get the link with the proof and or device link profile */
940
954
    if (include_softproof || include_devicelink || src_dev_link) {
943
957
                                                   cms_output_profile,
944
958
                                                   cms_devlink_profile,
945
959
                                                   rendering_params,
946
 
                                                   src_dev_link,
 
960
                                                   src_dev_link, cms_flags,
947
961
                                                   cache_mem->non_gc_memory);
948
962
        if (include_softproof) {
949
963
            gx_monitor_leave(proof_profile->lock);
953
967
        }
954
968
    } else {
955
969
        link_handle = gscms_get_link(cms_input_profile, cms_output_profile,
956
 
                                     rendering_params, cache_mem->non_gc_memory);
 
970
                                     rendering_params, cms_flags, 
 
971
                                     cache_mem->non_gc_memory);
957
972
    }
958
973
    if (!src_dev_link) {
959
974
        gx_monitor_leave(gs_output_profile->lock);
1110
1125
                    (gsicc_namedcolortable_t*) gs_malloc(pis->memory->stable_memory, 1,
1111
1126
                                                    sizeof(gsicc_namedcolortable_t),
1112
1127
                                                    "gsicc_transform_named_color");
1113
 
                if (namedcolor_table == NULL) return(-1);
 
1128
                if (namedcolor_table == NULL) return(gs_error_VMerror);
1114
1129
                /* Parse buffer and load the structure we will be searching */
1115
1130
                buffptr = (char*) named_profile->buffer;
1116
1131
                buffer_count = named_profile->buffer_size;
1137
1152
                    gs_free(pis->memory, namedcolor_table, 1,
1138
1153
                            sizeof(gsicc_namedcolortable_t),
1139
1154
                            "gsicc_transform_named_color");
1140
 
                    return (-1);
 
1155
                    return (gs_error_VMerror);
1141
1156
                }
1142
1157
                namedcolor_table->number_entries = num_entries;
1143
1158
                namedcolor_table->named_color = namedcolor_data;
1164
1179
                        (char*) gs_malloc(pis->memory->stable_memory,1,
1165
1180
                                          curr_name_size+1,
1166
1181
                                          "gsicc_transform_named_color");
 
1182
                    if (namedcolor_data[k].colorant_name == NULL)
 
1183
                        return gs_error_VMerror;
1167
1184
                    strncpy(namedcolor_data[k].colorant_name,temp_ptr,
1168
1185
                            namedcolor_data[k].name_size+1);
1169
1186
                    for (j = 0; j < 3; j++) {
1360
1377
       return dev_profile->link_profile->num_comps_out;
1361
1378
    }
1362
1379
}
1363