History of Ghostscript versions 9.xx

Table of contents

This document is a record of changes in Ghostscript releases numbered 9.xx. For earlier versions, see the the history documents:

History of Ghostscript versions 8.n
History of Ghostscript versions 7.n
History of Ghostscript versions 6.n
History of Ghostscript versions 5.n
History of Ghostscript versions 4.n
History of Ghostscript versions 3.n
History of Ghostscript versions 2.n
History of Ghostscript versions 1.n

For other information, see the Ghostscript overview.


Version 9.16 (2015-03-30)

This is the twelfth full release in the stable 9.x series, and is primarily a maintenance release.

Highlights in this release include:

For a list of open issues, or to report problems, please visit bugs.ghostscript.com.

Incompatible changes

No recorded incompatible changes.

Changelog

2015-03-20 00:11:26 +0000

2015-03-19 11:55:19 +0000
Chris Liddell <chris.liddell@artifex.com>
49ac7a284e46cf8df8eb553c91ee48a6b004652e

LCMS2 pointer alignment on SPARC/gcc

Building on commit 5a2da7dd71:

With gcc on (Ultra)SPARC hardware, pointers must be 8 byte aligned, even in
32 bit userspace (where sizeof(void *) == 4).

So it means taking special action to enforce 8 byte alignment in the LCMS2
memory management code.

We'll set the alignment for SPARC builds in the configure script.

No cluster differences.

config.mak.in
configure.ac
gs/Makefile.in
gs/configure.ac


2015-03-24 13:50:34 +0000
Chris Liddell <chris.liddell@artifex.com>
f2f22a246dcbe8468880535ea75f47e0fc4619ce

LCMS2 on SPARC ptr alignment.

Allow the ptr alignment for LCMS2 memory management to set at build time on the
compiler command line.

Submitted upstream:
https://github.com/mm2/Little-CMS/commit/dd0074b2

No cluster differences

gs/lcms2/src/lcms2_internal.h


2015-03-23 17:03:41 +0000
Chris Liddell <chris.liddell@artifex.com>
b96200d7fc5f3b7464744589f6657e9b4c4cb3ec

Bug 695882: ensure function protypes are available

There are some special defines on Linux to include prototypes for pread, pwrite
and pthread_mutexattr_settype: add these to our "unistd_.h" header.

Also, tweak the the configure script to check for prototypes as well as just
successful linking before including the code that uses those functions

No cluster differences

configure.ac
gs/base/gp_psync.c
gs/base/unistd_.h
gs/configure.ac


2015-03-24 11:07:43 +0000
Ken Sharp <ken.sharp@artifex.com>
9358edca362b60f8ace388768548e6e94f5ebec8

PDF Interpreter - ignore XRefStm entries which poitn beyond end of file

Bug #695883 "Error: /invalidaccess in --run--"

The file is pretty well broken, it claims to be a hybrid (PDF 1.5 or better
readable by PDF 1.4 consumer, it uses xref streams) and as such its trailer
dictionary contains an XRefStm key whose value is supposed to point to the
PDF 1.5 xref stream. It doesn't, in fact it points past the end of the file
and so is clearly bogus.

This commit tests to ensure the XRefStm value is inside the file before
attempting to read it.

No differences expected.

gs/Resource/Init/pdf_main.ps



Chris Liddell <chris.liddell@artifex.com>
6c56ffb81354dca442b69389b0f7a0b75e4e864e

Tweak builds for SPARC architecture

SPARC's interesting alignment requirements don't work with the memory header
ID code, so disable it.

No cluster differences.

configure.ac
gs/configure.ac



Chris Liddell <chris.liddell@artifex.com>
03d399b295f9a39f743eb194ebce0995d52d0bfb

Update versions and dates for release candidate.

gs/Makefile.in
gs/base/gscdef.c
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1
gs/psi/int.mak
gs/psi/msvc.mak
gs/psi/winint.mak


2015-03-19 13:50:07 +0000
Chris Liddell <chris.liddell@artifex.com>
a463733e35e1070a06029657dedb67148c33c87a

Handle an invalid cidfmap entry in the CIDFont subst code

Certain types of invalid entry in the cidfmap can mean that resourcestatus
returns "true" but a subsequent "findresource" will fail. There is already
validation code to strip out invalid entries, but as an extra safety measure,
call the findresource in a stopped context, so we can recover, and continue
with the next substitution fallback stage.

No cluster differences.

gs/Resource/Init/pdf_font.ps


2015-03-19 10:51:32 +0000
Chris Liddell <chris.liddell@artifex.com>
68f1390c29df09d2cc7cdb5c815c71aaa77f667c

Add instructions about using ghostpdf.inf on Windows 8

Add the instructions in the comments in ghostpdf.inf, and in a separate README
file.

Lots of "AT YOUR OWN RISK!!" comments in both.

No cluster differences.

gs/lib/ghostpdf.README
gs/lib/ghostpdf.inf


2015-03-19 10:49:34 +0000
Chris Liddell <chris.liddell@artifex.com>
2487b24d668f86350a1c5bdcf0e7a485470665e9

Correct a copy'n'paste mistake in a conditional

No cluster differences.

gs/configure.ac


2015-03-18 08:37:15 +0000
Chris Liddell <chris.liddell@artifex.com>
3c4edb1e23eec531b96194f85685b30656149732

Bug 695860: only shutdown BGPrint if it's active

Always forcing a setpagedevice interacts poorly with pdfwrite/ps2write (which
rely on the device shutting down to trigger emitting the final output).

Since vector devices cannot benefit from BGPrint, only disable BGPrint (with
setpagedevice) if BGPrint was active in the first place.

No cluster differences.

gs/psi/imain.c


2015-03-17 22:42:22 +0000
Chris Liddell <chris.liddell@artifex.com>
2ceee5a8a0e1a4d65f14de5f6cf53bb939b2f02c

Bug 695872: handle real/integer mixup in image Decode dict

In PDF we now pass the Height value from the image dict into the parameters
for the filter to access (specifically, the DCTDecodeFilter), and this will
cause an error if the Height value is, erroneously, a real rather than integer
value (the Postscript image operator appears to already handle that error,
at least in certain cases, gracefully).

So the filter code does not throw an error, round and convert the value to an
integer before storing it in the filter parameters dictionary.

No cluster differences.

gs/Resource/Init/pdf_draw.ps


2015-03-17 21:44:50 +0000
Chris Liddell <chris.liddell@artifex.com>
ace1b71cd0097ee830692e3e59738e084f5a4141

Fix a couple of typos in Install.htm

No cluster differences.

gs/doc/Install.htm


2015-03-17 18:05:51 +0000
Chris Liddell <chris.liddell@artifex.com>
41ff61ceceb55dd03da6b309c290c880c38fce04

Bug 692861: update Install.htm for "new" installer.

Bring Install.htm in-line with the nsis based Windows installer.

Also, remove references to Adobe Type Manager, and document that OpenVMS and
OS/2 are no longer actively supported by us.

No cluster differences

gs/doc/Install.htm


2015-03-17 16:38:50 +0000
Chris Liddell <chris.liddell@artifex.com>
b18cefb10c2391188d07ad0ca397e58121434b8b

Recursive mutex emulation: fix order of operations

We have to invalidate the self_id value *before* we unlock the mutex, as the
mutex implicitly protects the self_id (and lcount) value.

Also add asserts so we'll abort if the self_id and/or lcount get out of whack.

Finally, add a missing default value for RECURSIVE_MUTEXATTR in the ghostpdl
configure.

No cluster differences

configure.ac
gs/base/gp_psync.c
gs/base/lib.mak


2015-03-17 14:45:01 +0000
Chris Liddell <chris.liddell@artifex.com>
3dbcbb2ac75a8565534310cba189544ccdd1c1c4

Bug 695862: addendum - fix typo

No cluster differences.

gs/base/gp_psync.c


2015-03-16 22:18:41 +0000
Chris Liddell <chris.liddell@artifex.com>
edf3461901805376bdb1b9aa995df359531c7539

Fix a write after free memory issue.

No cluster differences

gs/base/stream.c


2015-03-16 12:52:49 +0000
Chris Liddell <chris.liddell@artifex.com>
444e0bf9c43bae0261660e6318ba0e514c18d41e

Bug 695862: use PTHREAD_MUTEX_RECURSIVE(_NP) if available

or properly emulate recursive mutexes ourselves.

No cluster differences

config.mak.in
configure.ac
gs/Makefile.in
gs/base/gp_psync.c
gs/configure.ac


2015-03-07 16:25:46 +0000
Chris Liddell <chris.liddell@artifex.com>
f1feefae4e6412d37db6abb46b492a74073964c7

Bug 691396: add new lines to FAPIdebug messages.

No cluster differences

tmp commit

gs/Resource/Init/gs_fapi.ps


2015-03-07 17:05:53 +0000
Chris Liddell <chris.liddell@artifex.com>
febe7a1acf152ef7379a126bfa65358604272b5a

Flush around FAPI "internal" debug messages.

Try to avoid the FAPI -Z1 messages stomping on other output messages by flushing
around the messages.

No cluster differences.

gs/base/fapi_ft.c
gs/base/fapiufst.c


2015-03-07 15:10:49 +0000
Chris Liddell <chris.liddell@artifex.com>
0f1d26a75ccb1adc806287f7e97af14af85f4fdf

Bug 692815: Fonts resourcestatus and native fonts

The core of the resourcestatus implementation for the Fonts category would
check the content of Fontmap, but would not trigger the native font scanning
to occur. So two invokations of resourcestatus for Font could result in
different results depending on whether, in the intervening period, another
operation had triggered the native font scan.

This could result in unexpected behaviour from the PDF interpreter where a
"synthetic" substitute could be created on the first page, and a native font
selected on the second page, for the same font name.

We'll now try to "find" the font for resourcestatus, if we fail, we'll try to
trigger the native font scan, and retry.

Further, I had missed the fact that this code used the Fontmap dictionary in my
previous commit, so it now accounts for the new NativeFontmap dict.

No cluster differences.

gs/Resource/Init/gs_fonts.ps
gs/Resource/Init/gs_res.ps


2015-03-05 14:56:51 +0000
Chris Liddell <chris.liddell@artifex.com>
3edd8e8e64c0b35364c2fdf2e13336191c023f4b

Bug 690653: fix order of font substitution mapping.

Previously, the enumeration of the "native fonts" (i.e. when using
fontconfig) wrote the mappings into the same Fontmap dictionary that is built
from the Fontmap file.

This could cause several problems. Firstly, it was possible for fonts found by
the native font search to effective replace the default font set - which should
*never* happen. Secondly, and even worse, the font found when trying to load
one of the default font set could change depending on whether a prior attempt
was made to load from from outside the default font, because the attempt to load
a font from outside the default set would trigger the Fontmap to change with the
native fonts being added.

We'll now keep the Fontmap dict from the Fontmap file separate from a new
native fontmap dictionary. We'll now check the Fontmap dictionary, then try to
load directly by name, then check the .nativeFontmap dict.

The .nativeFontmap also gets the results of scanning the directories in the
FONTDIR paremeter.

No cluster differences.

Bug 690653 (related): update pdf interp to use NativeFontmap

The pdf interpreter accesses Fontmap, so tweak it to also use NativeFontmap.

No cluster differences

gs/Resource/Init/gs_fonts.ps
gs/Resource/Init/pdf_font.ps


2015-03-16 18:29:09 +0000
Robin Watts <robin.watts@artifex.com>
0391d0e73c1892138b11c1416113e32b80d3317f

Update clusterpush.pl to cope with new mupdf source layout.

gs/toolbin/localcluster/clusterpush.pl


2015-03-16 08:39:36 -0700
Ray Johnston <ray.johnston@artifex.com>
949e2de694cb5464a26794b7679d8f74ad2fe02b

Temporary fix for bug 695711. Disable BGPrint when NumRenderingThreads > 0.

This will be fixed, but since background printing is an optimization, it is
better to disable it instead of having a SEGV occur due to a race condition.

gs/base/gdevprn.c


2015-03-16 10:08:52 +0000
Ken Sharp <ken.sharp@artifex.com>
d4440c2190845bdd165f3d208d508f45e2142bee

pdfwrite - process octal escapes in DSC comments

Bug #695850 - "DSC comments not being read correctly from PDFDocEncoding"

DSC comments are not encoded using PDFDocEncoding, nor are they PostScript
strings, they are a simple sequence of bytes. So it seems that we should
simply preserve that sequence in the output PDF file. However Distiller
behaves 'oddly' with DSC comments containing escape characters:

octal escapes (\ followed by 3 numbers) are converted into apparently a
PDFDocEncoding byte

non-octal numeric escapes (\ followed by less than 3 numbers or numebrs
which aren't octal) have the \ changed to a ?

non-octal non-numeric escapes (eg \n) simply get the escape dropped.

IMO this leads to problems, for example bug687660.ps has a %%Title which is
a DOS filename '%%Title: (C:\PHYSICS\TeX\SPINTRONICS\SPIN_HALL\gh_ef_001.eps)'
Distiller mangles this by dropping all the '\' characters to become
(C:PHYSICSTeXSPINTRONICSSPIN_HALLgh_ef_001.eps)

This commit alters the way that pdfwrite handles octal escapes *only*. These
are converted to binary and will then be encoded as if they were in
PDFDocEncoding which matches Distiller. We will not attempt to match the
observed behaviour of Distiller, not least because I think its completely
the wrong thing to do.


No differences expected

gs/devices/vector/gdevpdfp.c


2015-03-13 09:20:39 -0700
Michael Vrhel <michael.vrhel@artifex.com>
a16e39318467d8a802296bd34bbf0fab7f7809d5

Fix for bug 695863 overprint while pattern color is active

If a pattern color space is present when a graphics state swap occurs, and
the overprint changes from on to off in the graphics state the overprint
compositor is not disabled. In Bug 695863 a DeviceN image fill follows such
a case and the fill is improperly performed with overprint enabled. With this
commit we disable the overprint compositor if overprint is off. If overprint
is not off, it is not clear how we should proceed, as the color space is
a factor in that set up and here the color space is a pattern.

gs/base/gspcolor.c
gs/base/lib.mak


2015-03-10 22:05:52 -0700
Michael Vrhel <michael.vrhel@artifex.com>
64e33af885e49b40c0ebc070ede50e86a8ed3bdb

Change to check for len > 0 on while loop

Requested by a customer and protects against caller passing invalid len

gs/psi/dwmainc.c


2015-03-07 08:38:57 -0800
Michael Vrhel <michael.vrhel@artifex.com>
8e8a9c4265c3346055ecfc8025880cab28e268de

Fix for bug 693070 psdrgb device

The psdrgb device should not alter its number of components but it should stay
fixed. This commit plus b5b03bde360a7ba625a4c40a936c4e2fd5a32359
should fix the psdrgb device.

gs/devices/gdevpsd.c


2015-03-06 13:28:51 -0800
Michael Vrhel <michael.vrhel@artifex.com>
b5b03bde360a7ba625a4c40a936c4e2fd5a32359

PageSpotColors was getting handled by devn_get_params but not devn_put_params

For additive devices devn_put_params was not handling PageSpotColors but
devn_get_params was. This mismatch would lead to an error for the psdrgb
device, which is an additive device built upon the DeviceN device. Additive
devices do not handle apot colors at this time so the fix was to make
the handling of PageSpotColors in devn_get_params dependent upon the device
polarity like devn_put_params does.

gs/base/gdevdevn.c


2015-03-06 11:19:07 -0800
Michael Vrhel <michael.vrhel@artifex.com>
c75e5c690c6f9c1da2e9225d4986967d1d391c8b

Fix for bug 695791. Wrong ICC profile written when source was CIELAB colorspace.

gs/devices/vector/gdevxps.c


2015-03-03 18:59:17 +0000
Chris Liddell <chris.liddell@artifex.com>
12ddbaa69c38fa0178ff60a012ff358987b6238d

Handle non-integer /Rotate values.

Add a convert to integer (cvi) after retrieving the /Rotate entry from a PDF
/Page object (we already reject values that are not a multiple of 90).

In this case, the value was 90.0.

No cluster differences.

gs/Resource/Init/pdf_main.ps


2015-02-27 12:25:15 -0800
Michael Vrhel <michael.vrhel@artifex.com>
863c929faa7811ce6d78cb8d1b4610ee00a7a572

Fix mistake on temp state setup for named color replacement

I had not properly set up the colorant mapping positions and
size for the temporary graphic state that is used during the
storage of the color values that are set by the named color
replacement code. Thanks to Stefan for finding this.

gs/base/gxcmap.c


2015-02-26 18:01:04 -0700
Henry Stiles <henry.stiles@artifex.com>
7093747c7336656cfba938cff705b36fea6106c2

More improvement related to bug #695833 properly selecting LinePrinter
not Courier.

pl/plftable.h


2015-02-26 17:54:10 -0700
Henry Stiles <henry.stiles@artifex.com>
f4f0f0a92a543adef944c09ff065defe1c58fefe

Remove the test for a TrueType file type to make way for supporting
other font file types.

pl/pllfont.c


2015-02-25 07:44:51 -0800
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
70bd09212747f8b13e94948c04cadf5b0df65899

Silence a compiler warning in fuzzy.c

gs/toolbin/tests/fuzzy.c


2015-02-12 10:13:10 -0800
Ray Johnston <ray.johnston@artifex.com>
a2d08f1eb88355c81672668595f0b80f32386e48

Fix pattern-clist with transparency color mismatch with raster patterns

Cust 532 noticed that colors would be (very slightly) different when patterns
were rendered from raster patterns vs. using the pattern-clist approach. This
happened when the pattern has transparency such as fts_25_2526.ps.

The file tests_private/comparefiles/Bug692720.pdf is a progression (lower left
"21h" and "22h" are missing and the bold outline for some of the text on the
left panel is wrong without this change.

Fix it to make sure and push and pop a transparency group around the pattern
filling when pattern-clist is used, the same as for raster patterns that have
transparecncy. The 'blending_mode' was moved to the tile (gx_color_tile_s)
from the ttrans (gx_pattern_trans_s) struct so that it will be available when
painting from the pattern-clist.

Also remove some code in gxpcmap.c that was dead (#if 0) since 2007.

gs/base/gdevp14.c
gs/base/gsptype1.c
gs/base/gxclread.c
gs/base/gximask.c
gs/base/gxp1fill.c
gs/base/gxpcmap.c
gs/base/gxpcolor.h
gs/psi/zpcolor.c


2015-02-23 14:13:53 -0800
Ray Johnston <ray.johnston@artifex.com>
fb531eecd1942807a792ef66a1aa49ec00792d13

Fix bugs 695840, 695841. Regression due to pdf14_clist optimization.

If the color characteristics of the device do not match the pdf14
compositor, rendering the clist bands without the pdf14 compositor
will fail, either by reading colors with the wrong depth back from
the clist or colors having been pre-converted using a device ICC
profile that is different than the colors that are written using
the pdf14 compositor.

gs/base/gdevp14.c
gs/base/gdevp14.h
gs/base/gxclrast.c
gs/base/gxclread.c


2015-02-23 12:18:01 -0800
Michael Vrhel <michael.vrhel@artifex.com>
1dca5f29bf59d3071021a3ba4b7378e60d0e7a10

Fixes for named color support

A few minor fixes for named color support including the detection of the
None colorant in the DeviceN list of colorants. Making sure that the
equivalent CMYK color is correctly computed. Make sure that all the
colorants in the device are cleared out prior to setting the ones
associated with the device profile in the example code given in
gsicc_transform_named_color.

gs/base/gsequivc.c
gs/base/gsequivc.h
gs/base/gsicc_cache.c
gs/base/gxcmap.c


2015-02-23 10:15:02 -0800
Michael Vrhel <michael.vrhel@artifex.com>
46b59d18a8f4d204e83327e135c17657caefde3a

Fix issues with sICCOutputColors option

If an NCLR ICC profile is specified for output then it is also
possible to specify the colorant names associated with the profile.
This information is described by the sICCOutputColors parameter.
There was an issue where the default colorant names AND the
colorant names specified by sICCOutputColors were getting
added to the device. With this fix only the colorants specified
by sICCOutputColors are added to the device.

gs/base/gsdparam.c
gs/base/gsicc_manage.c
gs/devices/gdevpsd.c


2015-02-23 12:30:30 +0000
Chris Liddell <chris.liddell@artifex.com>
375752983d9373b28bf1fada04fc9325673bc51c

Bug 695516: fix psl.dev/psbase.dev deps snafu....

And also tidy dependency for PDF interpreter.

No cluster differences

gs/psi/int.mak


2015-02-23 11:49:08 +0000
Ken Sharp <ken.sharp@artifex.com>
1125d53f8db9f7402f37fa8fe7823257e4c6554a

PDF Interpreter - fix some kinds of FreeText processing

Bug 695848 "Ghostscript decode error when opening PDF"

The processing of the Default Appearance was mishandling some colour
specifications. It was expecting arrays for all operators, when in fact only
the (undocumented ?) 'r' operator takes an array, all the others simply
take a sequence of values.

gs/Resource/Init/pdf_draw.ps


2015-02-20 15:05:51 -0800
Michael Vrhel <michael.vrhel@artifex.com>
6ab5713f556bde0be38fa411e2eb1d25eb73e2c5

Use different remap proc for indexed color space when dealing with named colors

Currently the Index color space uses gx_default_remap_color for its remap procedure.
This is a problem for when we are dealing with an index color whose base space
is DeviceN and we are doing named color replacement in our color management. To
fix this, we introduce a different version of the Indexed color space that is installed
with a different remap proc for the case when we have a index color space whose
base space is DeviceN or Separation AND we have specified a named color ICC profile.

gs/base/gscolor2.c
gs/base/gscolor2.h
gs/psi/zcolor.c


2015-02-20 14:23:56 -0800
Michael Vrhel <michael.vrhel@artifex.com>
033cf566b74c7e12bfb82d9b63a7bc680c51c5f8

Add LockColorants option to tiffsep and psdcmyk devices

If someone specifies a list of colorants using something like this

-c "<< /SeparationColorNames [ /Cyan /Magenta /Yellow /Black /Violet /Orange]
/SeparationOrder [ /Cyan /Magenta /Yellow /Black /Violet /Orange]>> setpagedevice"

on the command line, it would be nice if they also had the option to
keep the colorants to only this set for the tiffsep and psdcmyk devices.

Currently, the list of colorants above would be included as well as any that
are encountered in the document (up to a max of 64). In some cases, this
may be the desired outcome. In other cases, the user may like to keep the colorants
to only those set by SeparationColorNames. Toward that end, this commits adds
a -dLockColorants=true/false option for the tiffsep and psdcmyk devices to
ensure that the devices do not add on additional colorants as they are
encountered in the document.

gs/devices/gdevpsd.c
gs/devices/gdevtsep.c


2015-02-20 09:51:50 +0000
Chris Liddell <chris.liddell@artifex.com>
5135b9cd1a26332af64ff3a770103d8d8ad001a0

Bug 695842: cope with no pread/pwrite available

Older Unix and Linux systems for example.

Without pread/pwrite we also disable multithreading support.

No cluster differences

config.mak.in
configure.ac
gs/Makefile.in
gs/base/gp_unifs.c
gs/configure.ac


2015-02-20 11:32:34 +0000
Chris Liddell <chris.liddell@artifex.com>
93ceb24e53ac62b5d6ac338dd8983e2e2a15eaad

Cope with systems with inttypes.h that doesn't define PRI..

The PRI... macros for printf formatting aren't always available, so cope better with that.

Solaris, for example.

No cluster differences

gs/base/stdint_.h


2015-02-20 11:30:26 +0000
Chris Liddell <chris.liddell@artifex.com>
5c7b12b0bfd990329b6ecd009afbfc4f037e8b48

Cope with systems without strnlen.

We'll use strnlen in preference, but replace it with strlen if strnlen isn't available.

An example would be Sun cc on Solaris.

No cluster differences

configure.ac
gs/configure.ac


2015-02-18 15:57:29 +0000
Chris Liddell <chris.liddell@artifex.com>
1e7626e4a9db58f9e5a531c04233bc8b04c52b1f

Bug 695836: add flag for MINGW binary file opening

MINGW, being a unix-like API on Windows, using the file handling gp_unifn.c,
but unlike "real" Unix systems, requires an extra flag for opening binary
files.

Add that conditional on being built for MINGW

No cluster differences.

gs/base/gp_unifn.c


2015-02-16 10:13:58 +0000
Ken Sharp <ken.sharp@artifex.com>
f27d8957a6afde54c0105fe6599b175b7ec46540

Increase the linewidth used in idiom recognition of artificial bold text

Bug #695835 "Artificially emboldened fonts not showing up as bold in output PDF"

I believe this to be an Acrobat display bug, different versions of Acrobat
display the result differently, modifying the viewer preferences alters the
boldness significantly, and opening another file also alters the displayed
boldness.

However, I've opted to increase the linewidth we are using slightly. This
results in a few single pixel differences in our output. At 600 dpi the
test file is slightly bolder, about 1 pixel worth.

Comparison against the PostScript output is slightly complicated, because
the 'fill and stroke' results in slightly smoother output than the 'draw
the glyph 4 times' approach. However, there is little significant difference
as far as I can tell.

gs/Resource/IdiomSet/Pscript5Idiom


2015-02-12 17:09:40 -0700
Henry Stiles <henry.stiles@artifex.com>
7b3af6d5075a23cd6b5ef199e7680be8ab1045a6

Fixes bug #695833 to correctly select the Line Printer font instead of
Courier.

We need to have a LinePrinter font entry in the font table for each
symbol set supported by LinePrinter. We were missing an entry for the
PS text (10J) symbol set.

pl/plftable.h


2015-02-12 13:24:58 +0000
Ken Sharp <ken.sharp@artifex.com>
4264a0716724dbd7fd8e35a53572e262658d5979

Fix error recovery after invalid type 1c (CFF) font

Bug #695819 "Ghostscript cannot process font stream"

The PDF file (which purports to have been produced by an earlier version
of Ghostscript) contains a CFF font which has en empty names index.

Ghostscript, not unreasonably, treats this as being 'the first byte of the
name is 0x00' which indicates a font which has been deleted from the
FontSet. This means that the embedded FontSet contains no fonts.

Since there are on fonts, we obviously can't use the font stream, and so
we enter an error recovery process. This exposes a problem specific to
this type of font, failing in this fashion, which left the operand stack
in a condition where we were unable to recover from the error.

This commit detects the error condition at an earlier stage and prevents
the change to the operand stack, which allows the missing font to be
substituted, and the file runs to completion.

No differences expected.

gs/Resource/Init/pdf_font.ps


2015-02-10 10:30:53 -0800
Michael Vrhel <michael.vrhel@artifex.com>
40e783f0274ede8a5a15caf878bd18cad1bfa690

Fix for crash issue in -dUseFastColor

The noncm link was storing the target device color mapping procs
and using those to map the colors. The problem is that some devices
(for example tiffsep) rely upon special device structures to
do the mapping. When we had a forwarding device like the overprint
device in front of the target, we were calling the target mapping
procs where we should be calling the overprint device mapping procs.
This commit fixes the issue.

gs/base/gsicc_nocm.c


2015-02-09 11:04:27 -0800
Michael Vrhel <michael.vrhel@artifex.com>
14ea68e33fa129addf3860e3bf760060aa100ce3

Fixes for named color replacement.

The sample code for named color replacement had several issues
that this commits fixes.

1) The memory allocations were not being done in non-gc memory.
2) There needed to be a release method to free the allocations
when we are done with the named color profile structure.
Since this is a "custom" profile, the release procedure for
a profile was added as a member variable to the profile structure.
3) The decision to use the named color profile was moved earlier
in the ghostscript color remapping logic. The ensures we
have better control and avoid unwanted multiple remaps.

Once the color is assigned values by the call to
gsicc_transform_named_color in gx_remap_named_color, note
that in gx_remap_concrete_devicen the transfer functions are applied.
Also note that in gx_remap_concrete_devicen we will end up doing
a possible ICC mapping of just the CMYK values from source CMYK to
destination CMYK via the call to devicen_icc_cmyk. The reason for
this is explained by the large comment in that part of the code.
If this remap is not desired, for example if gx_remap_named_color
assigned the CMYK values in the destination space already, then
this mapping should be disabled. The decision to enable or disable
is a design/customization decision of which the developer should be aware.

gs/base/gscdevn.c
gs/base/gscms.h
gs/base/gscsepr.c
gs/base/gsicc_cache.c
gs/base/gsicc_manage.c
gs/base/gxcmap.c
gs/base/gxcspace.h


2015-02-05 17:21:51 +0000
Ken Sharp <ken.sharp@artifex.com>
17131c7a7fdf9d8537c4715e538c49b29c8945a8

Improve high level devices handling of Forms

Bug #695805 "PostScript can defeat the code to spot PostScript forms being run multiple times "

High level devices (eg pdfwrite) already check Forms to see if they are
duplicates, and if so use the initial definition. However, this does not
improve performance, since the Form PaintProc still needs to be executed
for each instance of the Form.

This commit adds two new spec_op enums, and uses them to improve performance
as well, but *only* for high level devices.

After running a PaintProc, the PostScript .execform1 procedure now sends a
spec_op to the device requesting an integer ID to store in the Form. If the
device does not do its own form caching it will return -1, in which case
the PostScript will not store the value.

Each time a Form is executed, the PostScript code will look to see if we
have a non-null value stored for the Implementation key in the Form dictioanry.
If so, then we assume its a dictionary (ideally we should check, but this is
all tightly coupled code), pull the /FormID from it, and then send another
(different) spec_op to the device. On receipt of this the device simply
reuses its stored Form.

This absolves us from running the PaintProc again, which on some files can
have significant performance benefits. It also means that even Forms which
execute pdfmarks (as the original file does) will be recognised as the same
form, which the duplicate removal code cannot achieve.

The customer's test file runs in ~16 seconds now,producing a 4.3 Mb output
file, previously this produced an 81 Mb file and took around 20 minutes.

gs/Resource/Init/gs_lev2.ps
gs/base/gsform1.h
gs/base/gxdevsop.h
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfi.c
gs/devices/vector/gdevpdfx.h
gs/psi/zform.c


2015-01-23 09:48:50 +0000
Chris Liddell <chris.liddell@artifex.com>
be26bcf588c1dff9f8a867f764bb46b0d6389081

Update URW fonts to Jan 2015 release.

The families NimbusMono, NimbusRoman and NimbusSans have been augmented with
production quality Greek and Cyrillic glyphs. These correspond to our
substitutes for the PDF base 14 fonts

Lots of minor pixel level cluster differences, and
sumatra/664_-_accented_characters_missing.PDF

is progression with previously missing accented glyphs now printing

gs/Resource/Font/BookmanURW-DemBol
gs/Resource/Font/BookmanURW-DemBolIta
gs/Resource/Font/BookmanURW-Lig
gs/Resource/Font/BookmanURW-LigIta
gs/Resource/Font/CenturySchL-Bold
gs/Resource/Font/CenturySchL-BoldItal
gs/Resource/Font/CenturySchL-Ital
gs/Resource/Font/CenturySchL-Roma
gs/Resource/Font/CenturySchURW-Bol
gs/Resource/Font/CenturySchURW-BolIta
gs/Resource/Font/CenturySchURW-Ita
gs/Resource/Font/CenturySchURW-Rom
gs/Resource/Font/ChanceryURW-MedIta
gs/Resource/Font/NimbusMon-Bol
gs/Resource/Font/NimbusMon-BolObl
gs/Resource/Font/NimbusMon-Obl
gs/Resource/Font/NimbusMon-Reg
gs/Resource/Font/NimbusMonL-Bold
gs/Resource/Font/NimbusMonL-BoldObli
gs/Resource/Font/NimbusMonL-Regu
gs/Resource/Font/NimbusMonL-ReguObli
gs/Resource/Font/NimbusRom-Ita
gs/Resource/Font/NimbusRom-Med
gs/Resource/Font/NimbusRom-MedIta
gs/Resource/Font/NimbusRom-Reg
gs/Resource/Font/NimbusRomNo9L-Medi
gs/Resource/Font/NimbusRomNo9L-MediItal
gs/Resource/Font/NimbusRomNo9L-Regu
gs/Resource/Font/NimbusRomNo9L-ReguItal
gs/Resource/Font/NimbusSan-Bol
gs/Resource/Font/NimbusSan-BolIta
gs/Resource/Font/NimbusSan-Ita
gs/Resource/Font/NimbusSan-Reg
gs/Resource/Font/NimbusSanL-Bold
gs/Resource/Font/NimbusSanL-BoldCond
gs/Resource/Font/NimbusSanL-BoldCondItal
gs/Resource/Font/NimbusSanL-BoldItal
gs/Resource/Font/NimbusSanL-Regu
gs/Resource/Font/NimbusSanL-ReguCond
gs/Resource/Font/NimbusSanL-ReguCondItal
gs/Resource/Font/NimbusSanL-ReguItal
gs/Resource/Font/NimbusSanNar-Bol
gs/Resource/Font/NimbusSanNar-BolIta
gs/Resource/Font/NimbusSanNar-Ita
gs/Resource/Font/NimbusSanNar-Reg
gs/Resource/Font/PalladioURW-Bol
gs/Resource/Font/PalladioURW-BolIta
gs/Resource/Font/PalladioURW-Ita
gs/Resource/Font/PalladioURW-Rom
gs/Resource/Font/URWBookmanL-DemiBold
gs/Resource/Font/URWBookmanL-DemiBoldItal
gs/Resource/Font/URWBookmanL-Ligh
gs/Resource/Font/URWBookmanL-LighItal
gs/Resource/Font/URWChanceryL-MediItal
gs/Resource/Font/URWGothic-Boo
gs/Resource/Font/URWGothic-BooObl
gs/Resource/Font/URWGothic-Dem
gs/Resource/Font/URWGothic-DemObl
gs/Resource/Font/URWGothicL-Book
gs/Resource/Font/URWGothicL-BookObli
gs/Resource/Font/URWGothicL-Demi
gs/Resource/Font/URWGothicL-DemiObli
gs/Resource/Font/URWPalladioL-Bold
gs/Resource/Font/URWPalladioL-BoldItal
gs/Resource/Font/URWPalladioL-Ital
gs/Resource/Font/URWPalladioL-Roma
gs/Resource/Init/Fontmap.GS
gs/psi/psromfs.mak


2015-02-03 16:05:55 +0000
Chris Liddell <chris.liddell@artifex.com>
af9d47bf4ed5ebe42c1b2592a607bd891cd1dd92

Bug 695787: skip WOFF fonts in font scanning

As Ghostscript doesn't support WOFF fonts, skip them during the building of the
"native" fonts table - this prevents the pseudo-parsing from consuming large
amounts of memory and processor time pointlessly.

No cluster differences.

gs/Resource/Init/gs_fonts.ps
gs/Resource/Init/gs_ttf.ps


2015-02-02 13:31:32 +0000
Ken Sharp <ken.sharp@artifex.com>
8803294d1768a74a2ca3a1acc97f7def74752791

commit 23aab341f57c20974e4dfcb68abb13ce08c5e5a8 actually committed the wrong
code by accident, ooops!

This is the corrected test for a type 2 font being used. The comments in
the previous commit still apply, this isn't a 'fix' just a work-around to
avoid a crash.

gs/devices/vector/gdevpdtc.c


2015-02-02 11:52:49 +0000
Ken Sharp <ken.sharp@artifex.com>
23aab341f57c20974e4dfcb68abb13ce08c5e5a8

Noticed by chrisl while working on moving our installed base fonts to
CFF, if a type 0 font has an FDepVector which uses both a type 3 font, and
a base font (which is CFF) then we fail to process the condition where
we use one glyph from the type 3 and follow it with a glyph from the
type 2.

The problem seems to be that we get confused, we detect the error with the
CFF font, but instead of capturing it as a bitmap (fallback case) we end
up dealing with it as if we had started capturing a type 3 charproc. Of
course we didn't start capturing it that way, so that causes chaos.

In the long run this will need to be fixed properly (ie figure out why we
are ending the glyph with the current font being type 3, when it should be
type 2), but for now this prevents the GPF. When/if we do move to CFF fonts
for our base fonts, this will need to be revisited.

gs/devices/vector/gdevpdtc.c


2015-01-29 17:33:48 -0800
Ray Johnston <ray.johnston@artifex.com>
3af4b00ad39d7c3672f3967512d81b1f8ecf6bac

Fix some (probably not all) dependencies when the build has minimal devices.

The lib.mak was missing some dependencies, and pdf_main.ps depended on the
.pdfputparams which is only defined if the pdfwrite device is built in.
Tested with a build from: autogen.sh --with-drivers=ppmraw,pgmraw,pbmraw
which only has bbox and those devices.

gs/Resource/Init/pdf_main.ps
gs/base/lib.mak


2015-01-30 10:43:31 +0000
Ken Sharp <ken.sharp@artifex.com>
47178da0d32b82a40b75f9aa9684210ff4dc1d24

Remove the reference to -dLanguageLevel=1 in the man page.

Also remove the incorrect nonsense about language level 3 and so on, which
has never been correct, and some general tidying up. Also point out that,
despite the name of the scripts, PDF is an equally acceptable input.

Update the versions and dates and so on to reflect the edit.

gs/man/ps2ps.1


2015-01-28 08:34:08 -0800
Ray Johnston <ray.johnston@artifex.com>
704fcded8bb82dcbfad512ee8eec80e1d5655ded

Fix miscalculation of pattern size when 'has_tags' is true.

This fix was developed for customer 532 who uses tags. The 'has_tags'
passed in to gx_pattern_size_estimate is a boolean, so we should adjust
size for the extra tag byte, not the value (which doesn't have to be 1).

gs/base/gxpcmap.c


2015-01-23 17:32:36 -0800
Ray Johnston <ray.johnston@artifex.com>
8c015519af0f14ada59399a96d0f4ffc3c9e5ccd

Fix some debug statements that used NULL mem pointers.

gs/base/gxipixel.c


2015-01-22 08:35:39 -0800
Ray Johnston <ray.johnston@artifex.com>
c8cf49712712f288d5b956f36ecb285a39a2b134

Fix emprintf problem with previous commit

gs/devices/gdevplib.c


2015-01-21 13:41:35 -0800
Ray Johnston <ray.johnston@artifex.com>
cad213c2d188e7461322ee6f810684bea5358235

Fix BandHeight and segfault problems with plib device.

The BandHeight will be 0 initially to convey "set it automatically
if it isn't set on the command line. Only check once it has been
set.

Once past this a segfault was occurring because the mdev->line_ptrs
never was set. This seems to have been broken by commit c4357bef
caused by passing "mlines" into the device's setup_buf_device
rather than NULL in the call from clist_rasterize_lines (which
did fix another segfault).

Since regression doesn't test this device, I don't expect any
differences.

gs/devices/gdevplib.c


2015-01-20 16:01:07 +0000
Chris Liddell <chris.liddell@artifex.com>
f38db629f962a599693e13b572eef9ee64412800

Add the plib device family to build on Unix.

No cluster differences.

gs/configure.ac
gs/devices/gdevplib.c


2015-01-19 11:19:08 +0000
Chris Liddell <chris.liddell@artifex.com>
4d9083d4f20d53eda3ae129cd35d1947144db743

Commit the automake/autoconf/libtool derived files

For ijs the build is not expected to change, and if it does, it will be very
infrequent. So keeping the derived files in source control simplifies things.

No cluster differences

gs/ijs/Makefile.in
gs/ijs/compile
gs/ijs/config.guess
gs/ijs/config.sub
gs/ijs/configure
gs/ijs/install-sh
gs/ijs/libtool
gs/ijs/ltmain.sh
gs/ijs/missing


2015-01-19 11:15:02 +0000
Chris Liddell <chris.liddell@artifex.com>
c09cc83e53c9a1269e0c64fea94d9ceeafa9a494

Remove automake version specific tests/use

The script does unpleasant things which can cause us to attempt to use a
specific version of automake, which should not really be needed these days.

So we now just check that the automake version is greater than or equal to the
version we require.

The old method can still be accessed by invoking autogen.sh thus:
USE_OLD=yes ./autogen.sh

Also, reset the the minimum automake version to 1.6.

No cluster differences.

gs/ijs/autogen.sh
gs/ijs/configure.ac


2015-01-21 22:34:40 +0000
Chris Liddell <chris.liddell@artifex.com>
b2d6985a0fdc20c9775e3caa2f90af039cc5e2f5

Remove spurious debug code.

No cluster differences.

gs/Resource/Init/gs_type1.ps


2015-01-21 22:08:39 +0000
Chris Liddell <chris.liddell@artifex.com>
da65b995be88cfcbef7c99dbae1d15f5eb14122d

Bug 695794: fix invalidaccess with some Type 1 fonts

Use superexec to execute the .growput to enter the flag into the font dictionary
that indicates we've already applied the glyph mapping augmentation. Handles
the case that the font dictionary already readonly.

No cluster differences.

gs/Resource/Init/gs_type1.ps


2015-01-20 09:22:31 -0800
Ray Johnston <ray.johnston@artifex.com>
38501651d81ae41f6505e7f457f46a975648c63a

Fix C stack overflow with psdcmykog.

The commit fe0b8fcf increased the gp_filename_sizeof to 4096, and
this increased the stack usage for cmykog_process_arg_t by enough
to cause stack overflow on Windows.

gs/devices/gdevcmykog.c


2015-01-20 09:00:31 -0800
Ray Johnston <ray.johnston@artifex.com>
a8a479e6104a509de49b0d10d8aae6cc4cd4809a

Clean up gx_pattern_size_estimate to clamp at max_int

When the pattern had transparency, we had conditional assignment to
limit at (max_int * ~0xFFFF), but not otherwise. No known defect.

gs/base/gxpcmap.c


2015-01-19 09:15:47 +0000
Chris Liddell <chris.liddell@artifex.com>
2cc3a1779d832fc84b36f0ebb20336bbdad17352

Bug 695774: Fallback for glyph with degenerate bbox

If a glyph has only one very narrow feature, the bbox can end up with either
the width or height of the bbox being 0, in which case no raster memory is
allocated and no attempt is made to render the glyph. This is less than ideal
when the drop-out compensation in the rendering code would actually result in
the glyph being rendered.

Normally the coordinates for the bbox are rounded (which is technically
correct). Now, if that results in the width or height being 0, we'll
then try explicitly rounding up/down, providing a sort of naive whole glyph
drop-out compensation.

The same change has been included upstream and will be in the next scheduled
Freetype release:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=942aa5ff

This causes a large number of low resolution differences on cluster, all
progressions where glyphs like dash ('-'), underscore ('_') and vertical
bar ('|') were dropping out entirely, and are now printing.

gs/freetype/src/raster/ftrend1.c


2015-01-17 10:58:33 +0000
Ken Sharp <ken.sharp@artifex.com>
2c14b47453cc4c4bc6d6a97af073ae0145f107dd

txtwrite - properly terminate 'char' tags

Bug #695788 "txtwrite textoutput=0 XML file"

The 'char' tag was being terminated with a '>' instead of a '/>'.

Reported, and the offending code isolated, by Petko Lukov, who offered to
create a patch, but the change is so trivial I simply went ahead with it.

No differences expected, cluster doesn't test txtwrite.

gs/devices/vector/gdevtxtw.c


2015-01-17 09:01:00 +0000
Chris Liddell <chris.liddell@artifex.com>
8a72aff8e6f1009cce8cf0ed535baf3d6c362fb4

Slience a (benign) compiler warning about missing return

No cluster differences.

gs/psi/dxmain.c


2015-01-16 10:27:51 -0800
Ray Johnston <ray.johnston@artifex.com>
7882030e49b1309c6d8ccc96b799c8eddb0cc10d

Improve error message when required OutputFile not specified.

Bug 695767. Also improve the formatting when there was a filename
by adding ' around the filename,

gs/base/gsdevice.c


2015-01-16 15:26:56 +0000
Chris Liddell <chris.liddell@artifex.com>
66eafeeec0288a96dde38ecb406961c869ce06e4

Move bbox.dev to be immediately after the x11 devs

So that in pcl and xps on Unix, if we aren't including the x11 devices, we'll
default to bbox.

No cluster differences

main/pcl6_gcc.mak


2015-01-16 15:18:23 +0000
Chris Liddell <chris.liddell@artifex.com>
d1ef180b6cad83dde54843e028accb22222e6f39

Explicitly check for both libcups and libcupsimage

No cluster differences.

gs/configure.ac


2015-01-16 09:40:27 +0000
Ken Sharp <ken.sharp@artifex.com>
6e1e22c7643ee2e0b28a702a3ed9fc5b8f3a96b0

NTFS - fix some memory problems Bug 695752

Bug #695752 "gp_enumerate_files_close leaks some memory"

This appears to be a simple oversight in the original commit, a piece of
allocated memory was not freed, the 'free' call was commented out.

Noticed in passing; if the allocation of the file pattern fails, we were not
freeing the file or directory enumerators, leading to a memory leak as
well.

No differences expected (cluster does not test Windows file system)

gs/base/gp_ntfs.c


2015-01-15 16:16:59 +0000
Ken Sharp <ken.sharp@artifex.com>
d9168fef51ff878e58834b38d620f4afc9fa66c2

pdfwrite - fix compiler warning

The compiler complained that pres could be NULL. In fact it should never be,
it *should* be the same as pres1, but we ought to be dereferencing pres1 here
anyway, not pres, so we make that change, just in case.

gs/devices/vector/gdevpdfu.c


2015-01-14 10:51:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
65b46878adabda061b67670dfd81899acca2cea1

Fix warnings from f02d0a5

For some reason no warnings came up during the cluster push. Thanks
to those who fixed a couple. Hopefully this fixes the rest.

gs/base/gximdecode.c
gs/devices/vector/gdevxps.c


2015-01-13 12:31:40 -0800
Ray Johnston <ray.johnston@artifex.com>
48eb76b5b774772e39b0a163a9a3c1d06eafbdd4

Allow Orientation pagedevice parameter to control the FitPage rotation

With this change, Orientation is no longer ignored except for devices
that support pdfmark where it must be 0 (e.g., pdfwrite). Now with
-dFitPage, -c "<< /Orientation 0 >> setpagedevice" will use either 0
or 90 degree rotation, while -c "<< /Orientation 2 >> setpagedevice"
will rotate either 180 degrees or 270 degrees.

Note that Orientation 2 will invert a page (rotate by 180) if 270
degree rotation is not needed for the best fit.

Orientation will also control which way is "up" without -dFitPage,
but may result in clipping.

gs/Resource/Init/pdf_main.ps


2015-01-14 15:01:24 +0000
Chris Liddell <chris.liddell@artifex.com>
6213ab0b0c3229f1744e404e0d673d36f62bd6cd

Treat a couple of compiler warnings as errors.

Treat declaration-after-statement and return-type warnings as errors when
building with gcc.

No cluster differences.

configure.ac
gs/configure.ac


2015-01-14 15:01:02 +0000
Chris Liddell <chris.liddell@artifex.com>
d18f698b8e7176653d096b2e554eeff713be4182

Fix a missing return type for a function.

gs/devices/vector/gdevxps.c


2015-01-14 13:21:54 +0000
Ken Sharp <ken.sharp@artifex.com>
d7bffde12e3b9856e271af3b50254fd93d98b3d3

Fix 'warning: ISO C90 forbids mixed declarations and code'

Commit f02d0a5 added code which declares variables in the body of a
function. This is not permitted in C90 (or C89), is contrary to the coding
style for Ghostscript and fails to compile Ghostscript under Visual Studio.

In addition 'zip_close_all_archive_files()' did not have a return value on
success which led to random return values and a number of regression files
failing.

Moved the variables to the start of the functions (removing const as required)
and added a specific return code on success.

Now compiles under Windows, does not throw as many warnings on Linux and
does not cause spurious regression failures. There are still many warnings
produced by gcc, EG:

./devices/vector/gdevxps.c:1771:9: warning: unused variable 'count' [-Wunused-variable]
./devices/vector/gdevxps.c:1770:9: warning: unused variable 'code' [-Wunused-variable]

The author of the commit should address those separately.

gs/base/gximdecode.c
gs/devices/vector/gdevxps.c


2014-12-15 12:15:14 -0800
Michael Vrhel <michael.vrhel@artifex.com>
f02d0a5067a0970aa5e9c6b4f9cd08956485447e

Add support for encoded source images with xpswrite device. Fix for bug 695698

Also fixes 695754 and 695680.

The xps format does not allow for the image data encodings that PDF source files can
create. Hence we have to decode the data prior to writing out to our TIFF file.
The clist image code had static methods for doing the decode during color monitoring. These
methods were re-factored to work on a new structure that are now member variables for
the xpswrite image enum structure and the clist image enum structure. The methods and
the structure definition were placed in their own file gximdecode.c/h

Also this adds support for images in indexed, CIELAB, DeviceN and separation color spaces.

Finally, images are stored in a temp file during creation and then copied into the zip
archived, releasing the image temp file. ICC profiles are written directly from memory
to the zip file. This avoids having lots of temp files around for each image that is
created. A similar process needs to be done for other parts of the xps document. With the
current architecture of having a temp file open for every "file" in the package we would
not be able to create something larger than 512 pages on windows due to the limit on
the number of open files.

gs/base/gxclimag.c
gs/base/gximdecode.c
gs/base/gximdecode.h
gs/base/lib.mak
gs/devices/devs.mak
gs/devices/vector/gdevxps.c
gs/ghostscript.vcproj


2015-01-13 11:19:53 +0000
Ken Sharp <ken.sharp@artifex.com>
3e7115492c378ffa324c0a083244a785a6a61f82

pdfwrite - optimise pdf_foget_resource with CharProc resources

Bug #695778 "Long delay converting .ps file to .pdf file"

The specimen file uses glyphshow to draw a huge number of 'characters',
these turn out to be bitmaps which, taken together create the page. Each
page defines and at the end specifically undefines a type 3 font and the
glyphs are stored in this font.

Since PDF has no equivalent to glypshow we store the glyphs in multiple
type 3 fonts, resulting in around 10 times as many fonts. The creation and
storage of the fonts and glyphs is quite slow.

However, we start off unaware that this is a glyphshow operation, so we
start by attempting to capture the type 3 CharProc. Its not until we get
to the actual capture of the bitmap that we discover we cannot handle the
glyph like this. That means we have to discard the CharProc we had begun,
and remove it from the list of stored resources.

Now resources are stored in 'chains' which is a simple way of limiting the
number of searches. We hash on the resource ID and pick the chain based on
that.

The first problem was that pdf_forget_resource was not using the hash, it
was checking every entry in every chain, in effect checking all the entries
of a given resource type. Even if it found a match, it continued checking
the remaining chains! As the number of stored CharProcs (we still store
the glyphs as CharProcs, but in a different font) increases, the time taken
to exhaustively check all the glyphs increases.

Here we fix that by starting from the correct chain based on the hash of
the id (if its 0 we start at the first chain, so if we haven't allocated an
ID we check all the entries). When we find a match we return immediately
instead of merely exiting the *inner* loop.

The second problem is that we don't allocate an ID for CharProcs initially.
This is fixed by storing the ID which we used temporarily as an argument
to pdf_enter_substream.

Taken together these speed up this file by a factor of ~8.

No differences expected.

gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpdti.c


2015-01-13 09:28:37 +0000
Chris Liddell <chris.liddell@artifex.com>
7d97b54d767627d1d88ea026c3d3accd11cb670f

Bug 695783: correct cups return of string parameters

The cups device was using param_string_from_string() to return string parameters
allocated in the device structure in its get_params method. Of the many problems
this could cause, it came to light due to the same parameter being sent through
put_params thus causing strncpy() to attempt to copy a string to itself, causing
a segfault.

Changing to the correct param_string_from_transient_string() way to return such
strings resolves the problem.

No cluster differences.

gs/cups/gdevcups.c


2015-01-12 11:10:04 +0000
Chris Liddell <chris.liddell@artifex.com>
f29420b18ba7abedb649d0352fb1b16adae1d4a5

Bug 695743: LCMS: Fix a macro clash on SNONE

Partial patch pulled from Marti's github repo:
https://github.com/mm2/Little-CMS/commit/5bc4f52f

(only the macro clash fix).

No cluster differences.

gs/lcms2/src/cmscgats.c


2015-01-12 09:56:01 +0000
Chris Liddell <chris.liddell@artifex.com>
84d749a65e509c31805a8f99d1aad78c013f13e6

Bug 695764: allow compiler to be overridden

Allow the C compiler to set by the configure script.

No cluster differences.

common/gccdefs.mak
config.mak.in
configure.ac


2015-01-12 08:44:46 +0000
Chris Liddell <chris.liddell@artifex.com>
e17fcc029c96949982b8f01c6e649b87dceab1be

Bug 695772: account for clist icc_table being shared

When multi-thread rendering is used (but not background printing), the icc_table
is shared between all the render thread devices and the 'parent' device in the
interpreter thread - but it is not reference counted. We rely on the fact that
the device in the interpreter thread will exist before, and persist past the
death of the rendering threads.

So, when dismantling a rendering thread device, null the icc_table entry so
it doesn't get erroneously freed.

No cluster differences.

gs/base/gxclthrd.c


2015-01-09 11:25:01 +0000
Chris Liddell <chris.liddell@artifex.com>
30abb3d5d5fbf9cf67d4ff691e898c8b29e39a56

Add automake option to make dist "self contained"

The automake default is to symlink to a few scripts ('compile', 'missing' etc)
in the current system's automake install. That results in a configuration
reliant on automake being installed, and the same version, for a build.

Add the '--copy' automake option so the script files are copied rather than
linked, so we get a self contained configure/make/install setup.

No cluster differences.

gs/ijs/autogen.sh


2015-01-09 11:23:34 +0000
Chris Liddell <chris.liddell@artifex.com>
9961f351a3c71949da49eb75b65560028fb8272e

Bug 695148: remove spec PDF and PS from clean list

As the IJS spec hasn't changed in ages, we'll just keep the PDF and PS files
of the spec in git, so no need to remove them with a "make clean".

No cluster differences.

gs/ijs/Makefile.am


2015-01-07 07:57:36 -0800
Ray Johnston <ray.johnston@artifex.com>
d78594c1982682a06c9fb8fc7f2ea746938a93cc

Fix problem in xps_zip_alloc_items caused by previous commit: 188c7b0

When the allocation succeeded, nothing was returned.

xps/xpszip.c


2015-01-03 16:00:16 -0800
Ray Johnston <ray.johnston@artifex.com>
188c7b05a5c232ba43e6b3172023498f7aa72c70

Fix segfault with ppmraw -r300 from fts_06_0626.pdf.xpse when allocation fails

The gxps had numerous places where allocation failures were ignored,
writing to RAM at offsets from 0 (NULL). This no longer fails, but the
fixes are not yet complete. Running a memento build with the parameters:
MEMENTO_SQUEEZEAT=1 gxps -o /dev/null -sDEVICE=ppmraw in.xps

xps/xpsdoc.c
xps/xpsfont.c
xps/xpsgradient.c
xps/xpshash.c
xps/xpsimage.c
xps/xpsjpeg.c
xps/xpsjxr.c
xps/xpspath.c
xps/xpspng.c
xps/xpsresource.c
xps/xpstiff.c
xps/xpsxml.c
xps/xpszip.c


2015-01-02 22:48:56 -0800
Ray Johnston <ray.johnston@artifex.com>
f553eec30efa8cbefdc3c3635e090abb915a1a9d

Fix bug 695373: xpswrite leaves temp files on Windows.

There is a recent addidtion of a gp function to open a temp file that
will be deleted upon close: 'gp_open_scratch_file_rm'. The method of
'unlink' after open does not work on Windows. This function is platform
specific and works on all supported platforms even if the process crashes.

Also get rid of confusing error messages. PageSpotColors is now only
given to devices that support it (pdf_main.ps) and NumRenderingThreads
and BGPrint are ignored for vector devices (gdevvec.c).

gs/Resource/Init/pdf_main.ps
gs/base/gdevvec.c
gs/devices/vector/gdevxps.c


2014-11-24 11:13:33 -0800
Ray Johnston <ray.johnston@artifex.com>
64f9cafcfc594ddaa1d1981a16f45fce25e4fb18

Fix BGPrint=true SEGV and slowdown due to commit 9108db2

Bug 695669:
The BGPrint problem was due to using the fname afer freeing it but the
'fake_path_to_file' logic needed the fname in order to find the real
file to close.

Tail of commit 6ecc8536:
Also the original cfname and bfname (ocfname and obfname) were copied
using strnlen so the trailing NULL wasn't copied resulting in UMR being
used for the close/delete.

Tail of bug 693121:
The performance of unbuffered I/O is slow, seen on many files, but
a good example is: tests/df/Bug6901014_Fourth_crash_signature_testcase.pdf
with params: -sDEVICE=pbmraw -o /dev/null -r300 -dMaxBitmap=0

The fix for this is to add a read cache. This caching method in intended
to also be used by the memory based clist logic (TBI).

With the cache, the performance on the above goes from 40 seconds down to
4.6 seconds, and with -dBGPrint=true reduces to 3.8 seconds (which crashes
prior to this fix).

gs/base/gdevprn.c
gs/base/gxclfile.c
gs/base/gxclist.c


2014-12-30 09:18:31 -0700
Henry Stiles <henry.stiles@artifex.com>
7631204934e5d8b0bcdb13d8691370365eb84b2b

Add directory entry configuration support to fix a broken ghostpdl
build after a Mac upgrade to Yosemite.

configure.ac


2014-12-23 16:01:05 +0000
Ken Sharp <ken.sharp@artifex.com>
35bb14eaf871b6a7e41e17688bcc41a1fb4da595

pdfwrite - add 'Launch' Actions

Bug #695715 "Launch action link annotations removed after GS processing"

Add Launch actions to the PDF interpreter, for both annotations and
outlines.

No differences expected.

gs/Resource/Init/pdf_main.ps


2014-12-23 13:53:27 +0000
Ken Sharp <ken.sharp@artifex.com>
fde4b9b183a140b8906874d0bf56d258b488d4b9

pdfwrite - free copied base fonts on exit

Bug #695753 "Segfault in gs_purge_font_from_char_caches_forced with -Z@"

The problem here is that we free copied fonts when we free the associated
FontDescriptor (because until then we need the copied font). However, if
we have a 'base 14' font, or other font which is not embedded, we do not
create a FontDescriptor, and so never free the font copy we take when the
font is used.

This later causes a problem because when the garbage collector frees this
font copy it is still pointing to a font cache which no longer exists.

This commit tests to see if a FontDescriptor is associated with a font when
we free the (PDF) font. If it is not then we free the copied font there and
then, as well as the ancillary bytes used for the font name etc.

No differences expected.

gs/devices/vector/gdevpdtf.c


2014-12-23 13:08:08 +0000
Ken Sharp <ken.sharp@artifex.com>
bd2e9c2c30b0696ca9f929637193aaef38951e6a

follow up to commit dc2c3634aeae6634b130e124b1f0997f17ee3141

Separate GoTo and GoToR processing for links as well as Outlines

gs/Resource/Init/pdf_main.ps


2014-12-22 11:29:49 +0000
Ken Sharp <ken.sharp@artifex.com>
01b9c47eefd7f88195e71f877e5ea44f183a0067

pdfwrite - when writing Names array use better method to find /Last

Bug #695704 "GS 9.15 (still) breaks *something* in hyperref-generated pdf BOOKMARKS"

The find_last_dict_entry code should have returned the same results as for
find_next_dict_entry, but it clearly didn't, resulting in effective
truncation of the Names array.

Simplified the code here by using find_next_dict_entry in a loop to locate
the last entry. This should mean we cannot be out of sync, the code is simpler
and easier to follow.

No differences expected.

gs/devices/vector/gdevpdfo.c


2014-12-22 10:47:22 +0000
Ken Sharp <ken.sharp@artifex.com>
dc2c3634aeae6634b130e124b1f0997f17ee3141

pdfwrite - separate GoTo and GoToR processing

Because we convert any named destination in a GoTo to a specific internal
destination, we cannot handle GoTo and GoToR in the same way. Here we
split the two again, and this time add a comment so we don't end up merging
them again by mistake.

No differences expected.

gs/Resource/Init/pdf_main.ps


2014-12-20 10:57:39 +0000
Ken Sharp <ken.sharp@artifex.com>
2c525aa076d7094fa487621602b8e326c58eeabe

pdfwrite - improve Goto and GoToR handling

Bug #695747 "git produces broken pdf from pdfTeX output"

The original code for generating pdfmarks from the equivalent annotations
in a PDF file did not properly create an Action dictionary, which caused
/D and /Dest entries to be removed.

Here we handle this more cleanly, and properly create the Action dictionary

NB for ps2write this relies upon commit b5a4f24141ab47b5ba2b7b3dff938ba30a8a908a
being present, in order to deal with the empty objects produced by ps2write.

No differences expected.

gs/Resource/Init/pdf_main.ps


2014-12-20 10:53:28 +0000
Ken Sharp <ken.sharp@artifex.com>
b5a4f24141ab47b5ba2b7b3dff938ba30a8a908a

ps2write - handle empty object definitions

object definitions such as:

5 0 obj
endobj

cause errors. Handle this by checking in /endobj to see if the stack count
is 1 (only the object number is present) and if so, do not attempt to
define the object.

gs/devices/vector/opdfread.h
gs/lib/opdfread.ps


2014-12-19 13:10:03 -0700
Henry Stiles <henry.stiles@artifex.com>
7df6f9570c00c34a3e1d6c74d66186a371208f0e

Integrate Ken Sharp's solution to preserve PCL transparent text in
pdfwrite to fix bug #695731.

PCL characters are rendered transparently when the current color is
white and pattern transparency is on. Usually this is done by simply
not printing or rendering the effected text. For high level devices
like pdfwrite we try to preserve the original intent of the source
document and include the text and transparency setting in the output.

pcl/pcl.mak
pcl/pctext.c


2014-12-19 15:31:24 +0000
Chris Liddell <chris.liddell@artifex.com>
9b3669dbcd3d29cd212e9961fcfc7b98780aa408

Add link to description of "Vienna" naming style

After a discussion on IRC: a summary of the "Vienna naming style" is actually
later in the document, this just adds a link between the early reference and
the fuller summary.

No cluster differences.

gs/doc/Ps-style.htm


2014-12-18 17:12:49 +0000
Chris Liddell <chris.liddell@artifex.com>
09def28ae012fc0e1b4f65ea55b19639c7737bc9

Bug 695750: fix icc link cache leak when freeing clist devices

No cluster differences.

gs/base/gdevprn.c


2014-11-24 22:47:15 -0700
Henry Stiles <henry.stiles@artifex.com>
5ddbec6f11792e2fa974c95924a984f876a9a705

Simplify rectangle output to be vertical and horizontal lines instead
of general lines.

The vertical and horizontal line commands take 1 argument resulting in
more compact XPS and we'd expect it to be faster when rendered.

gs/devices/vector/gdevxps.c


2014-12-18 11:35:44 +0000
Ken Sharp <ken.sharp@artifex.com>
8e196062593b295421b869db9d5cd9ab22f7205e

pdfwrite - some changes to text handling for Tr 3

Bug #695731 "PCL interpreter doesn't send text to the graphics library if its not visible."

Altering the PCL interpreter to set the Text rendering mode to 3 for
'invisible' text demonstrated a few problems in pdfwrite.

1) If the last character drawn was in Tr 3, and we buffer some new text in
Tr mode 0, but we are inside a gsave, and the outer state is Tr 0, then when
we restore back to the Tr 0 the mode is not emitted for the buffered text. Leaving
it as Tr mode 3. To fix this (and potentially other similar graphics state
problems) we now call sync_text_state when we reset text, this will
potentially flush the text buffer as well.

2) We were not using the text rendering mode from the graphics state when
falling back to a type 3 bitmap font, because the character code was out
of range (falling back for other reasons *did* preserve it).

This commit fixes these two problems.

Because of the change to text flushing some text is being drawn 1 pixel different
in location, presumably due to rounding differences, I've reviewed these
and they look fine to me.

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdti.c


2014-12-17 20:48:42 +0000
Chris Liddell <chris.liddell@artifex.com>
06a462093e4145073a61e6ca62aabbb343e39fa1

Bug 695745: apply resourcestatus hook only once.

pdfwrite requires that Type 32 fonts be disabled, and it does it by hooking
the resourcestatus operator. The problem is, because we always append
to the operator table, if we string a number PS files together from the
PScript5.dll, we can end up overflowing the operator table by repeatedly
doing the resourcestatus hook.

This just puts a boolean into systemdict to note that we're already applied
the hook, and there don't do it again.

No cluster differences.

gs/Resource/Init/gs_pdfwr.ps


2014-12-15 08:21:18 +0000
Ken Sharp <ken.sharp@artifex.com>
07150250834717499b74c87d00a8dc52599d33ec

pdfwrite - pass imager state through coloured patterns as well

commit eef2764 passed the imager state through to the underlying routines
for uncolored patterns. This commit extends the same change to include
coloured patterns.

No differences expected.

gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfg.h
gs/devices/vector/gdevpdfv.c


2014-12-13 12:24:11 +0000
Ken Sharp <ken.sharp@artifex.com>
3570b4830e7f54f3a057176bc01db04ec311fe23

pdfwrite - increase predefined minimum CompatiblityLevel

To avoid having to create V2 profiles, increase the minimum value of
CompatibilityLevel in the predefined PDFSETTINGS to 1.5

No differences expected

gs/Resource/Init/gs_pdfwr.ps


2014-12-13 11:16:08 +0000
Ken Sharp <ken.sharp@artifex.com>
eef2764f3f9ab6dac88ea6720a05693c1d19af43

pdfwrite porpagate the imager state through the pdfwrite Pattern code.

Bug #695733 "Error using pattern under odd conditions"

If we set UseCIEColor, so that all colours are converted into CIEBased spaces,
*and* we set CompatibilityLevel < 1.5 so that we require to convert ICCBased
profiles to V2, and then use a Pattern colour space, pdfwrite throws an
error.

This is because we were not propagating the image state through the pattern
code, and the new colour code requires the imager state in order to generate
a V2 ICC profile for inclusion in the PDF file.

Here we simply pass the imager state through for use.

No differences expected

gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfg.h
gs/devices/vector/gdevpdfv.c


2014-12-12 13:09:43 -0800
Michael Vrhel <michael.vrhel@artifex.com>
e153528e1f5044d2018284fbf2eea45b545232fe

xpswrite device: fix for missing images.

Force vector device to do new path as the clip path is the image path.
I had a case where the clip path ids were the same but the CTM was changing
which resulted in subsequent images coming up missing on the page. i.e. only
the first one was shown.

gs/devices/vector/gdevxps.c


2014-12-12 10:20:31 -0800
Michael Vrhel <michael.vrhel@artifex.com>
36c89af1edf269fe68f61c48326ff257862e274d

Fix for broken make file introduced in 878ef4d48a0aebc9354ccd09443a1a52ad93c9a0.

When adding the libtiff capability into the xpswrite device, I failed to update the devs.mak
file. This broke the Windows release 64x build. Not sure why the other platforms were also
not broken. Likely something is not getting cleaned up during a clean and rebuild.

gs/devices/devs.mak
gs/devices/vector/gdevxps.c


2014-12-11 12:07:15 +0000
Chris Liddell <chris.liddell@artifex.com>
27ce88cce7024691f292071cb602c119afc91f61

Bug 694509: Fix file name "building" for resources

After we'd created a candidate file name, there was a spurious "exch" in
place before we actually tried to validate the file name.

So, instead of "<path-to-resources>/<Resource Category>/<Resource Instance>"
being passed to .libfile, we actually passed the Postscript "path":
"<Resource Category>/<Resource Instance>"

Simply removing the exch seems to resolve this bug for me.

No cluster differences.

gs/Resource/Init/gs_res.ps


2014-12-05 13:59:31 +0000
Chris Liddell <chris.liddell@artifex.com>
dbcb29d2508de6ea997cf07d0987c107cd754cfb

Bug 695711: Resolve issue with relative paths for FONTPATH

Check whether a "lib" file exists, and whether we are allowed to open it,
before we try to open it.

This reverts ""starting_arg_file" should only apply once." (commit
407cc61e87b0fd9d44d72ca740af7d3c85dee78d).

Which caused problems with, for example, the "-sFONTPATH=..." option when the
path is relative rather than absolute.

No cluster differences.

gs/psi/imainarg.c
gs/psi/zfile.c


2014-12-04 08:24:32 +0000
Chris Liddell <chris.liddell@artifex.com>
ac4bfb62efdef25bf6d60c7f6a985dc6344891ca

Bug 695712: Revise glyph name map generation for TT fonts

Reinstate the unicode cmap and formatted "uniXXXX" glyph name methods of
finding glyph name maps, but in a more efficient method than the original
implementation.

No cluster differences.

gs/Resource/Init/gs_ttf.ps


2014-12-11 14:45:36 +0000
Ken Sharp <ken.sharp@artifex.com>
2207f06c5647e4308622733df854e49e2d48c97f

Handle a 'q' during the course of a 'W.....n' sequence

Bug #695723 "Inverted images when converting PDF to Tiff (B&W)"

The 'W' (and W*) operators are unlike their PostScript equivalents, and all
other PDF operators, they don't take effect immediately they simply add to
the clip path and produce a new clip path. Not until the 'n' is executed do
they actually apply the clip path. The Ghostscript PDF interpreter handles
this by accumulating the path operations (W/W*) until a 'n' is encountered.

Normally nothing else would need to be done, but because we've seen broken
PDF files that change the graphics state while accumulating a clip, and we
know that Acrobat ignores these, we have to track this. We do this by using
a dictionary.

So each graphics state operator checks the current dictionary to see if we
are inside a 'W' context and if so emits a warning and drops the change.
Again, so far so good.

However, the 'q' starts a new dictionary (pushing the existing 'W' one back
one level), which means that the 'n' operator closes that new dictionary
instead of the one it should close, and that brings the 'W' dictionary back
to the front.

Now when we execute the '1 1 1 rg' it looks at the dictionary and says "aha,
we are in a 'W' state, so ignore this".

This commit has the 'q' operator check to see if we are in a 'W' context. If
we are we copy the context dictionary to the stack, and close it. Then we
start the q 'nodict' dictionary. Finally we reopen the 'W' dictionary from
the stack. Now the 'n' will correctly close the 'W' dictionary, leaving the
'nodict' in its place.

No differences expected.

gs/Resource/Init/pdf_ops.ps


2014-10-31 13:30:04 +0000
Chris Liddell <chris.liddell@artifex.com>
813dc08154a525e5acca20b5da446eb58199680f

Update jbig2dec version and CHANGES file

No cluster differences

gs/jbig2dec/CHANGES
gs/jbig2dec/config_win32.h
gs/jbig2dec/configure.ac
gs/jbig2dec/jbig2dec.1


2014-11-19 15:02:22 +0000
Chris Liddell <chris.liddell@artifex.com>
66710da50af90cca72c2c8ea4942f3c4a23c9e5b

Bug 695688: improve cidfmap record validation.

The previous record validation only checked for valid substitutions when the
substitution referenced a TTF file (and removed the mapping if the TTF file was
not available). It ignored name to name mappings.

This revision adds validation to the name to name mappings, again removing
ones found to be invalid.

No cluster differences.

gs/Resource/Init/gs_cidfm.ps


2014-09-24 12:30:27 -0700
Michael Vrhel <michael.vrhel@artifex.com>
878ef4d48a0aebc9354ccd09443a1a52ad93c9a0

Add high level image handling to xpswrite device.

This adds the ability to create high level image content with the XPS write device.
It includes the writing of the ICC profile for the image and will support gray, rgb,
and cmyk images. Currently it only supports 8 bit per color channel bit depth.

Conflicts:
gs/devices/vector/gdevxps.c

gs/base/gsicc_cache.c
gs/base/gsicc_cache.h
gs/base/gsicc_create.c
gs/devices/vector/gdevxps.c
gs/ghostscript.vcproj


2014-11-18 09:16:05 +0000
Ken Sharp <ken.sharp@artifex.com>
a476643d942cfbcc6f68e7470e0d8425d31435ce

Documentation - remove some odd switches from examples in ps2pdf.htm

gs/doc/Ps2pdf.htm


2014-11-17 11:33:42 -0800
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
7d5a454da233c45775f640f251cec5c035e1ee55

Minor fixes to clusterpush documentation (done primarily to force an update of md5sums).

gs/toolbin/localcluster/clusterpush.pl
gs/toolbin/localcluster/clusterpush.txt


2014-11-17 14:22:44 +0000
Ken Sharp <ken.sharp@artifex.com>
abcaeaace08efa5d1596ef6a50f3d809d0b07a4a

pdfwrite - remove the force to the old CMS for PDF/A-1

Before we could guarantee a V2 ICC profile we forced the CMS to be the old
version for PDF/A-1. Now that we can guarantee a V2 profile this is no longer
required, and is removed here.

No differences expected.

gs/devices/vector/gdevpdfp.c


2014-11-14 12:15:45 -0800
Ray Johnston <ray.johnston@artifex.com>
4a37526a0606a29f0f0a86cd4b815ec7d966a1a0

Improve performance of PDF TJ operator to avoid repeated setfillstate

Add TextFillStateNeeded and add settextfillstate that conditionally
performs setfillstate only once for the operations.

gs/Resource/Init/pdf_ops.ps


2014-11-13 14:30:37 -0700
Henry Stiles <henry.stiles@artifex.com>
b669cfb4d3805adbcc2d7d7a3fa9fad3e9645aa1

Warning cleanup and remove an obsolete PCL XL colorspace type.

gs/base/gdevpxen.h
pcl/pcfsel.c
pcl/pglabel.c
pl/plftable.h
pxl/pxgstate.c
pxl/pxink.c
pxl/pxptable.c


2014-11-12 23:03:50 -0800
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
a814674105d9b57d5751e21d4a803df9fa4a4856

Added xpswrite option to clusterpush.pl.

gs/toolbin/localcluster/clusterpush.pl


2014-11-12 16:50:50 -0700
Henry Stiles <henry.stiles@artifex.com>
40bc5a9477192f663d66ffcad75cd14d7dac43ab

Fix 695673: symbol set not used correctly.

If we don't support a requested symbol set we map the font directly
with the character codes, i.e. the symbol mapping is identity. Due to
an historical artifact we used to map symbol and wingding fonts
without symbol sets by just adding 0xf000 to the input character code,
thus evolved the conditional to check if the font is internal and the
symbol set is 0 just add 0xf000 because it must be a wingdings or
symbol font. Of course that is wrong even if very rarely encountered,
and unnecessary because we've added the symbols sets needed to support
wingdings and symbol.

pcl/pctext.c
pcl/pglabel.c
pl/plsymbol.c
pl/plsymbol.h
pxl/pxfont.c


2014-11-10 14:31:44 +0000
Ken Sharp <ken.sharp@artifex.com>
c98c38c8b9912fc3510ef2e1e53c3ff1837b0519

eps2write - don't clamp text BBox to the text enumerator origin

Bug #695671 "eps2write gives incorrect bounding box with rotated text"

The bug here is that, having gone to some effort to retrieve the bounding
box of the text, the code then clamps the origin of the text box to the
origin of the text enumerator.

This is clearly incorrect for rotated text, and I'm doubtful it makes sense
even for upright text. I'm somewhat puzzled because it looks quite deliberate
but I don't see why, and my testing shows no differences if I don't do this.

So I'm removing this for now, this may need some more attention in the future
but then that is still generally true of the eps2write device.

No differences expected, the eps2write device is not cluster tested.

gs/devices/vector/gdevpdte.c


2014-11-06 09:53:05 +0000
Ken Sharp <ken.sharp@artifex.com>
b7fa37ecf0f25b125fafeed15873963853148276

Documentation change - improve and correct MaxShadinBitmapSize documentation

gs/doc/Ps2pdf.htm


2014-11-05 15:57:10 +0000
Ken Sharp <ken.sharp@artifex.com>
7bdf34b3dfd52e3897cef02e7c540270c10e2349

PDF Interpreter - run annotations in a stopped context for error-and-continue

Bug #695453 "Conversion to png fails with undefinedresult in --run--"

The PDF test file was supplied privately, it contains 3 annotations, each of
which is invalid having /Rect, /QuadPoints or /BBox arrays where each
element is 0.

Here we simply run the annotation inside a stopped context so that if it
throws an error we can raise a message and carry on.

No differences expected.

gs/Resource/Init/pdf_main.ps


2014-11-05 10:33:15 +0000
Ken Sharp <ken.sharp@artifex.com>
25b7ec08e8fed8a69c9b3ac75fbf3ccc43693e7c

PDF interpreter - attempt to recover from empty stream with broken endstream

Bug #695664 "Problem reading PDF file: stream length incorrect"

The file has an annotation with a broken stream, its empty (Length 0) and
the endstream keyword is incorrectly written as endsteam.

When we encounter the endobj we attempt to unwind back to the object number
and generation on the stack, but we don't have those on the stack, so instead
we consume the error recovery information, which then leads to the stream
code being unable to recover from the error condition, resulting in an error.

This change to endobj looks to see if either of the 2nd and third entries
on the operand stack are a 'mark', and if so assumes that this is a broken
empty stream, pops back to the mark and exits leaving cleanup to the
stream code.

Clearly this code can be defeated, depending on what garbage is left behind
by the broken stream, but in general we might reasonably expect to find two
integers before a mark object. Even if we don't, the result will still be no
worse than at present.

No differences expected

gs/Resource/Init/pdf_base.ps


2014-11-03 15:36:55 +0000
Ken Sharp <ken.sharp@artifex.com>
b2a6decb294ca8c48c71da2211f3284b2334d921

PDF interpreter - make unrecognised operators obey PDFSTOPONERROR

Bug #695661 "Ghostscript command hangs indefinitely"

The PDF file is badly corrupted, Acrobat fails to display most of page 27,
MuPDF complains of zlib errors.

Ghostscript also emits many warnings and then proceeds to spend an interminably
long time subdividing a curve. At resolutions up to ~25 dpi its reasonably
quick, after that its a long time indeed.

We can't simply catch the zlib errors like MuPDF, as bug #688716 indicates
that, under at least some conditions, Acrobat ignores these errors.

The problem seems to be caused by the fact that the corrupted data includes
some truly massive co-ordinates, but we can't simply ignore those either
as a real number can vary up to +/- 3.403 x 10^38. Possibly we could limit
numbers representing co-ordinates to 14,400, since that's the maximum
Acrobat can use, but that would mean a *lot* of reworking in the PDF
interpreter.

The best I can come up with short of that is to make malformed numbers
throw an error, and honour PDFSTOPONERROR, which to be frank should have
been the case already.

No differences expected.

gs/Resource/Init/pdf_base.ps


2014-10-16 12:26:24 +0100
Chris Liddell <chris.liddell@artifex.com>
a3bb342587cc7247420a05ff2428c4c94da194c0

Bug 695593: Add the MAKEDIRS target wherever it was missing.

MAKEDIRS target was missing from a large number of object files and other
files created during the build process. This could cause problems when
running parallel make instances.

No cluster differences.

gs/base/expat.mak
gs/base/fapi_bs.mak
gs/base/freetype.mak
gs/base/ijs.mak
gs/base/jbig2.mak
gs/base/jpeg.mak
gs/base/jpegxr.mak
gs/base/lcms2.mak
gs/base/lcups.mak
gs/base/lcupsi.mak
gs/base/ldf_jb2.mak
gs/base/lib.mak
gs/base/lwf_jp2.mak
gs/base/openjpeg.mak
gs/base/png.mak
gs/base/tiff.mak
gs/base/trio.mak
gs/base/unix-aux.mak
gs/base/zlib.mak
gs/devices/contrib.mak
gs/devices/devs.mak
gs/psi/int.mak


2014-10-31 12:39:45 +0000
Chris Liddell <chris.liddell@artifex.com>
0f0b9350206c99e5f4b73fe639ed3e085066fe5e

Fix and improve bit-rotted jbig2dec/libpng build on Windows

The Windows jbig2dec build incorporating libpng had bit-rotted, credit to
Ray for identifying the problems there.

In addition, I've added provision for specifying the libpng and zlib source
paths on the nmake command line, and automatic inclusion of libpng if
the path appears valid.

No cluster differences.

gs/jbig2dec/jbig2_image_png.c
gs/jbig2dec/msvc.mak


2014-10-30 10:59:01 +0000
Chris Liddell <chris.liddell@artifex.com>
69a6dc944e63a4a037eccc0d0cba5dee6bf9f272

Fix annoying, hard to reproduce ICC related warning

Occasionally, and in hard to reproduce circumstances, we could get a warning
from the ICC code:
./base/gsicc_manage.c:1084: gsicc_open_search(): \
Could not find <garbage string>

This, it turns out, is because the get_params code was returning a pointer to
a string allocated in non-gc memory, which just isn't compatible with the
way the Postscript interpreter interacts with the graphics library.

This commit changes the way the parameter is returned so it copies the string
into gc memory, compatible with use in a Postscript string object. Note that the
put_params equivalent code was already correct in copying the string from gc
memory into non-gc memory managed by the device code.

No cluster differences

gs/base/gsdparam.c


2014-10-27 21:19:44 +0100
Simon Bünzli <zeniko@gmail.com>
ee0bc20cc98c8e8381003a25dfa0b21e681c6545

replace jbig2_arith_get_offset with jbig2_arith_has_reached_marker

The DOS check introduced with 6e1f2259115efac14cd6c7ad9d119b43013a32a1
tries to determine whether arithmetic coding has run out of data and
has entered an infinite loop. It does so by checking how many bytes
have been read and compares with the number of bytes available. The fix
however fails to take into account bytes which have been cached in
_Jbig2ArithState::next_word which causes valid images to be rejected.

This patch corrects that bug by replacing that check with a generic
check as to whether the end of the data stream has been reached (which
is the case if the only two remaining cached bytes are 0xFF and a value
larger than 0x8F).

Signed-off-by: Henry Stiles <henry.stiles@artifex.com>

gs/jbig2dec/jbig2_arith.c
gs/jbig2dec/jbig2_arith.h
gs/jbig2dec/jbig2_symbol_dict.c


2014-09-27 13:51:32 +0200
Simon Bünzli <zeniko@gmail.com>
9157d6a5fccf109eb6554557eb8904b281571d28

Bug 694892: fix typo in 5eaf740b2c02523ae2ae6454e546cb6700d4e3f3

Signed-off-by: Henry Stiles <henry.stiles@artifex.com>

gs/jbig2dec/jbig2_metadata.c


2014-10-29 09:29:09 +0000
Chris Liddell <chris.liddell@artifex.com>
f6789d068a5f7af9cfead5120930893955123be1

Correct a small out-of-dateness related to COMPILE_INITS

No cluster differences

gs/doc/Make.htm


2014-10-28 17:09:17 +0000
Ken Sharp <ken.sharp@artifex.com>
cd2c4af1dd92bc4cc32170254c84498792913c0e

PDF interpreter - ignore /Contents array entries which don't resolve to dicts

Bug #695645 "PDFWrite fails on file with Error: /typecheck in --run--"

The specimen file has a /Contents array where one of the elements is an
indirect reference to another array. This isn't legal, entries in the
/Contents array must be references to streams. Acrobat simply ignores the
error and displays the page blank.

Here we check each entry before we process it, and if its not a dictionary
we ignore it, exit the loop processing the entries (as Acrobat apparently does)
and emit a warning.

No differences expected.

gs/Resource/Init/pdf_main.ps


2014-10-28 16:28:30 +0000
Ken Sharp <ken.sharp@artifex.com>
e21bb3e597825215da7ad4d757585fa96eb39909

PDF interpreter - provide a default BBox for Forms

Bug #695632 "Error: /undefined in --.PDFexecform--"

Type 1 Form XObjects are required to have a /BBox, but this example file
incorrectly omits it. Here we add a default (incorrect) BBox just to work
around the error. We also emit a warning that the file is damaged.

No diffreences expected.

gs/Resource/Init/pdf_draw.ps


2014-10-28 15:55:48 +0000
Chris Liddell <chris.liddell@artifex.com>
282c8f902d98543aee12931e69087180829bc8d1

Remove paragraphs relating to GNU readline

No cluster differences.

gs/doc/Make.htm


2014-10-28 10:49:37 +0000
Chris Liddell <chris.liddell@artifex.com>
05c2e0876019551d65f8f79655f34aa5adb5ca27

Update the docs for fonts and COMPILE_INITS

No cluster differences.

gs/doc/Fonts.htm
gs/doc/Make.htm
gs/doc/Use.htm


2014-10-27 19:12:15 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d39b321e4927dfafa428af8c25bddb791b14e15b

Update color management documentation.

gs/doc/GS9_Color_Management.pdf
gs/doc/GS9_Color_Management.tex


2014-10-23 09:35:26 +0100
Chris Liddell <chris.liddell@artifex.com>
db7ac4892625633204fad65ffa0da6dbaf43fc6a

Bug 695598: cidfmap validation problems on Windows

Originally, the cidfmap validation used "stat" to check whether the font file
was available (and remove the mapping if the font file is missing). But it
seems, for some (currently unidentified) reason, stat can fail even if the
font file is actually avaiable.

This changes the validation code to use ".libfile" and "file" operators to
check whether the font file can be found - this, it seems, works, even in cases
where "state" fails.

No cluster differences.

gs/Resource/Init/gs_cidfm.ps


2014-10-22 13:30:08 +0100
Ken Sharp <ken.sharp@artifex.com>
352645ff149aa690074030995ef33e1c2e4c35a0

Xpswrite - properly initialise PrinterName

Bug #695617 "Error: Printer name too long"

The xpswrite device doesn't include a full definition of its devicestructure
or initialisers for its variables.

This can lead to problems if any of these variables are exposed via
put/get params as the initial parameter will be uninitialised (put and get
params are called before the device open method)

Here we add a 'finish_copydevice' method and initialise the PrinterName
in it. Devices are created by calling copydevice on the device prototype
and the finish_copydevice method is called as the last action from there
so its safe to initialise the variables, and this will be completed before
put/get params is called.

No differences expected

gs/devices/vector/gdevxps.c


2014-10-22 14:04:14 +0200
Tor Andersson <tor.andersson@artifex.com>
648aba52e1430277035471709e3d6596c7016a35

Fix 695618: Keep a tail pointer to speed up parsing long XML documents.

xps/xpsxml.c


2014-10-20 09:55:22 -0600
Henry Stiles <henry.stiles@artifex.com>
c477d95f3e6cf50da2dc125c8d8335a440d9970d

Restrict xpswrite PrinterName device paramater to windows platform.

gs/devices/vector/gdevxps.c


2014-10-19 17:54:28 -0600
Henry Stiles <henry.stiles@artifex.com>
54f69da6cdeae9dcffcb1d060ccbeef3e0d4f7b0

Bug #695578 - Continue parsing a numeric parameter if a bad character
is found before a legal value.

This refines an earlier fix, bug #694725 which implemented skipping
the rest of the numerical parameter when a bad character was parsed.

Thanks to Norbert Janssen for finding and fixing this problem.

pcl/pcparse.c


2014-10-19 10:31:42 -0600
Henry Stiles <henry.stiles@artifex.com>
75a6c77aaa4278d462834f08b8da23dabc4566d7

Change warnings to debug statements.

gs/devices/vector/gdevxps.c


2014-10-19 10:07:57 -0600
Henry Stiles <henry.stiles@artifex.com>
8eadbf5b901588e86886f7ab42462c2486e9f561

Fix warnings introduced with "saved page" work.

pl/plmain.c


2014-10-19 09:52:33 -0600
Henry Stiles <henry.stiles@artifex.com>
d9a5f2f04b57d09f7f8c2082b29edd43fc96dcb0

Remove repetive accessors for 2 user options (interpolate and nocache)
and replace with single routine in pl.

pcl/pctop.c
pl/plmain.c
pl/plmain.h
pxl/pxl.mak
pxl/pxtop.c


2014-10-11 09:46:19 -0600
Henry Stiles <henry.stiles@artifex.com>
d93848b56be856aaa41a7e16fa42c141219244f5

Add -dNOCACHE to the usage help statement that runs when the program
is run incorrectly or incompletely.

pl/plmain.c


2014-10-11 09:42:52 -0600
Henry Stiles <henry.stiles@artifex.com>
88ed32c13b7bca6c259dc29502a40446bf34f75b

Implement NOCACHE parameter. We only support the simple case of
specifying the parameter or not. Right hand side values of /true and
/false are not supported.

pcl/pcfont.c
pcl/pcstate.h
pcl/pctop.c
pl/plmain.c
pl/plmain.h
pl/pltop.h
pxl/pxstate.c
pxl/pxstate.h
pxl/pxtop.c
xps/xpstop.c


2014-10-10 11:56:28 -0600
Henry Stiles <henry.stiles@artifex.com>
f072fac051e5f008488e5eea66cc76876516ec47

Error handling was wrong, objects were dereferenced before checking if
the allocation failed.

xps/xpstop.c


2014-10-18 07:55:27 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
6715211e308d753a79b35663f951a239704b8092

Fix compile issue with Luratech introduced in 74d5e9fb7d70d3d3d9cf964c76c550134c822020.

The change from a char * to an enum for psdf_image_params_s->AutoFilterStrategy
required a change in gdevpsdi.c.

gs/devices/vector/gdevpsdi.c


2014-10-14 12:39:27 +0100
Ken Sharp <ken.sharp@artifex.com>
5bf2c272781f20dc2ed4ca8a461166543846f422

ps2write - undo PDF name escaping for Separation colours

Bug #695590 "Spaces in spot colour names are encoded to "#20""

The opdfread header wasn't applying the conversion from PDF escaped names
when the name was an entry in a Separation colour space.

No differences expected.

gs/devices/vector/opdfread.h
gs/lib/opdfread.ps


2014-10-10 11:26:45 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
63b484c3040aa644fff2ed2a0861ac8cb082aafb

Bug 695146: patch for missing lrintf

OpenJPEG uses lrintf() which can be missing, or in this case, the prototype is
missing from the math.h header file - causing faulty output.

This patch checks for the function prototype, if it's missing it replaces the
lrintf() call with a naive round/cast implementation.

Two reasons for choosing this approach: it saves maintaining a patch against
OpenJPEG, and secondly, this is only relevant to older systems - more up to
date systems have lrintf() correctly prototyped, and often have implementations
optimised to the hardware, so we really want to use it if it's available.

No cluster differences.

gs/configure.ac


2014-10-07 14:33:08 -0600
Henry Stiles <henry.stiles@artifex.com>
8095a1010b799d5e36ac5bf4a5b67356362df607

Upon macro creation there is no need to search the dictionary for a
like named macros and delete it, the dictionary entry is recycled later
when we add the macro.

pcl/pcmacros.c


2014-10-07 09:28:38 +0100
Ken Sharp <ken.sharp@artifex.com>
ca7cea181d7905cb460ad6f82f234d3ee8d5efce

pdfwrite - fix a logical error in the AutoFilterStrategy params

This code was originally present only when using the Luratech decoder
but would have been incorrect there too.

Spotted while looking at a scan-build warning

gs/devices/vector/gdevpsdp.c


2014-10-05 20:55:39 +0100
Chris Liddell <chris.liddell@artifex.com>
1f3e40cf0fbbbb9a1c8085584f3e411cb112d9b4

Bug 695555: fix check to simulate overprint.

Mirror condition from pdf14_mark_fill_rectangle() in
pdf14_copy_alpha_color() to decide whether we should apply overprinting.

No cluster differences.

gs/base/gdevp14.c


2014-10-06 18:00:46 +0100
Ken Sharp <ken.sharp@artifex.com>
4018f1158984093380971ba1f4096b599c2d639e

PDF interpreter - improve error recovery with PDF form execution

Bug #695537 "Ghostscript locks up reading attached PDF file"

The problem is that, after we execute a form, we attempt to 'grestore' back
to the gsave depth at the time we executed the form, this is to try and
cater for broken form streams that have unbalanced Q/q operators.

This is done by counting the dict stack before the form execution, and after
the form is complete. If the depth is different we execute 'Q' in a loop
until we get back to the same dict stack depth.

This assumes that the only reason for having more dictionaries on the stack
is due to them being pushed by our implementation of 'q'. However in this
case (and more generally, in any event) we have created some dictionaries
then encountered an error, and returned control back to the form execution
routine.

As stated this calls 'Q' in a loop expecting that each 'Q' will decrement
the number of dictionaries by 1 each time. But 'Q' only does that if the
dictionary is the result of a 'q' if it isn't it leaves it in place.

So the form execution simply carries on round the loop forever.

This commit addresses this by checking the number of items on the dict
stack before and after executing 'Q' and if they are the same, it executes
the 'end' operator instead to remove the topmost dictionary from the stack.

This allows us to carry on removing gstate or general dictionaries until
we get back to the correct depth.

Note that, because there is a genuine error in the file, we do not render
it 'correctly', but neither does any other PDF consumer. Other consumers
render more of it than we do, but they all drop the 'Fannie Mae' logo.

No differences expected

gs/Resource/Init/pdf_draw.ps


2014-10-06 17:06:27 +0100
Ken Sharp <ken.sharp@artifex.com>
33e70f43badc2581757549bba55747af3f966622

colour handling - remove continuations from the exec stack on error

If we get an error (not running another PostScript function), we were not
removing our continuation procedure and data from the execution stack
before exiting setcolorspace.

This led to the interpreter exiting instead of simply flagging an error.

No bug report for this, discovered while working on bug #695537

gs/psi/zcolor.c


2014-10-06 16:37:37 +0100
Ken Sharp <ken.sharp@artifex.com>
74d5e9fb7d70d3d3d9cf964c76c550134c822020

pdfwrite - Correct Gray and ColorImageAutoFilterStrategy

A number of problems here; firstly the commit that added these to the
distiller params has the correct names in the commit message, but the names
used in the code were incorrect (eg ColorAutoFilterStrategy).

Secondly the parameter is supposed to be a name, but the data stored
was a C string, and get_params was returning an integer, so it actually
contained half the memory pointer value.

The parameters weren't added to .distillerparamkeys so currentdistillerparams
didn't return the values.

The default value for the non-Luratech case should have been /JPEG but in
fact /JPEG2000 was used in both cases.

99-01-fixed.ps should dhow up as a diff this time, and then should cease
being indeterminate with the pdfwrite device, as we now return the correct
name rather than half a random memory location.

gs/Resource/Init/gs_pdfwr.ps
gs/devices/vector/gdevpsdf.h
gs/devices/vector/gdevpsdp.c


2014-10-05 19:37:24 +0100
Paul Gardiner <paul.gardiner@artifex.com>
e72d03c68bfb6afaa0b90f6b717f91aef67b6c07

Fix compiler warnings introduced by temp-file commit

gs/base/gxclfile.c
gs/base/unistd_.h


2014-10-05 17:14:09 +0100
Ken Sharp <ken.sharp@artifex.com>
5d4d9d9772765501cac81b9b181ecc83f900d08a

pdfwrite - move outline relocation after the outline action relocation

Bug #695354 "Segmentation fault splitting PDF"

Move the pointer relocation for outline levels so that it takes place after
we relocate the outline actions, otherwise we can end up corrupting
memory.

No differences expected

gs/devices/vector/gdevpdf.c


2014-07-24 12:50:17 +0100
Paul Gardiner <paul.gardiner@artifex.com>
9108db24fef88855199038a257bf935a698af2f4

Avoid failure to clean up temp files when the execution is killed

This currently works only for Windows and Linux builds. For Windows, temp
files are created with the "delete on close" option. For Linux, temp
files are immediately unlinked on creation. In both cases, the initially
opened FILE pointer is kept open throughout execution, and reader access
is provided by duplicating the initial FILE rather than opening a new
FILE pointer based on the file name.

gs/base/gp.h
gs/base/gp_macio.c
gs/base/gp_mswin.c
gs/base/gp_os2fs.c
gs/base/gp_unifs.c
gs/base/gp_vms.c
gs/base/gxclfile.c


2014-10-03 13:40:21 +0100
Chris Liddell <chris.liddell@artifex.com>
0a8ac7c25438fbd4c406fc735c9c0fbd9f05c527

Bug 695244: ensure a consistent allocator for DCT streams.

The existing code could result in a mis-match between the memory allocators
used for the DCT specific parts of the stream and the main body of the stream.

As both are in gc memory, this could result, when the stream goes out of scope,
in the DCT specific memory being garbage collected before the main stream
object. As the main stream object contains the "finalize" method, the call to
finalize would result in accessing already freed memory.

This commit revises the code to use the same method to work out the allocator
to use for the main stream object as we do for the DCT specific parts.

No cluster differences.

gs/psi/zfdctd.c


2014-10-02 21:54:56 +0100
Chris Liddell <chris.liddell@artifex.com>
8f16e6dc73550d3e8f339a609e2dc51998616330

Bug 695561: remove .DS_Store files

No cluster differences.

gs/lcms2/Projects/mac/.DS_Store
gs/lcms2/Projects/mac/LittleCMS/.DS_Store


2014-09-30 17:35:02 +0100
Chris Liddell <chris.liddell@artifex.com>
f85afab4a4584c79f309e8f5691f5955605c67b5

Address two compiler warnings.

No cluster differences.

gs/base/gdevprn.c


2014-09-30 08:58:55 +0100
Chris Liddell <chris.liddell@artifex.com>
b460743bdc6c8c4de5fca260224673ca839b11e6

Remove LCMS.

No cluster differences.

gs/Makefile.in
gs/base/lcms.mak
gs/configure.ac
gs/lcms/AUTHORS
gs/lcms/COPYING
gs/lcms/ChangeLog
gs/lcms/Delphi/Samples/MAKETEST.BAT
gs/lcms/Delphi/Samples/TEST.PAS
gs/lcms/Delphi/Samples/create.pas
gs/lcms/Delphi/Samples/gamutchk.pas
gs/lcms/Delphi/Samples/getxyz.pas
gs/lcms/Delphi/Samples/sRGB Color Space Profile.icm
gs/lcms/Delphi/Samples/testfrm.pas
gs/lcms/Delphi/Samples/testwp.pas
gs/lcms/Delphi/delphidemo.cfg
gs/lcms/Delphi/delphidemo.dof
gs/lcms/Delphi/delphidemo.dpr
gs/lcms/Delphi/delphidemo.res
gs/lcms/Delphi/demo1.dcu
gs/lcms/Delphi/demo1.ddp
gs/lcms/Delphi/demo1.dfm
gs/lcms/Delphi/demo1.pas
gs/lcms/Delphi/lcmsdll.pas
gs/lcms/INSTALL
gs/lcms/Lib/BC/BC.txt
gs/lcms/Lib/MS/MS.TXT
gs/lcms/Makefile.am
gs/lcms/Makefile.in
gs/lcms/NEWS
gs/lcms/Projects/BorlandC_5.5/lcms.rc
gs/lcms/Projects/BorlandC_5.5/lcmsdll.lk
gs/lcms/Projects/BorlandC_5.5/lcmsdll.lst
gs/lcms/Projects/BorlandC_5.5/mklcmsdll.bat
gs/lcms/Projects/VC2005/Python.vcproj
gs/lcms/Projects/VC2005/Testbed.vcproj
gs/lcms/Projects/VC2005/icc2ps.vcproj
gs/lcms/Projects/VC2005/icclink.vcproj
gs/lcms/Projects/VC2005/icctrans.vcproj
gs/lcms/Projects/VC2005/jpegicc.vcproj
gs/lcms/Projects/VC2005/lcms.rc
gs/lcms/Projects/VC2005/lcms.sln
gs/lcms/Projects/VC2005/lcms.vcproj
gs/lcms/Projects/VC2005/lcmsdll.vcproj
gs/lcms/Projects/VC2005/resource.h
gs/lcms/Projects/VC2005/tiffdiff.vcproj
gs/lcms/Projects/VC2005/tifficc.vcproj
gs/lcms/Projects/VC2008/Python.vcproj
gs/lcms/Projects/VC2008/Testbed.vcproj
gs/lcms/Projects/VC2008/icc2ps.vcproj
gs/lcms/Projects/VC2008/icclink.vcproj
gs/lcms/Projects/VC2008/icctrans.vcproj
gs/lcms/Projects/VC2008/jpegicc.vcproj
gs/lcms/Projects/VC2008/lcms.rc
gs/lcms/Projects/VC2008/lcms.sln
gs/lcms/Projects/VC2008/lcms.vcproj
gs/lcms/Projects/VC2008/lcmsdll.vcproj
gs/lcms/Projects/VC2008/resource.h
gs/lcms/Projects/VC2008/tiffdiff.vcproj
gs/lcms/Projects/VC2008/tifficc.vcproj
gs/lcms/Projects/VC6/Python.dsp
gs/lcms/Projects/VC6/Python.plg
gs/lcms/Projects/VC6/Testbed.dsp
gs/lcms/Projects/VC6/Testbed.plg
gs/lcms/Projects/VC6/icc2ps.dsp
gs/lcms/Projects/VC6/icclink.dsp
gs/lcms/Projects/VC6/icctrans.dsp
gs/lcms/Projects/VC6/jpegicc.dsp
gs/lcms/Projects/VC6/lcms.dsp
gs/lcms/Projects/VC6/lcms.dsw
gs/lcms/Projects/VC6/lcms.opt
gs/lcms/Projects/VC6/lcms.rc
gs/lcms/Projects/VC6/lcmsdll.dsp
gs/lcms/Projects/VC6/resource.h
gs/lcms/Projects/VC6/tifficc.dsp
gs/lcms/Projects/VC7/Python.vcproj
gs/lcms/Projects/VC7/Testbed.vcproj
gs/lcms/Projects/VC7/icc2ps.vcproj
gs/lcms/Projects/VC7/icclink.vcproj
gs/lcms/Projects/VC7/icctrans.vcproj
gs/lcms/Projects/VC7/jpegicc.vcproj
gs/lcms/Projects/VC7/lcms.rc
gs/lcms/Projects/VC7/lcms.sln
gs/lcms/Projects/VC7/lcms.vcproj
gs/lcms/Projects/VC7/lcmsdll.vcproj
gs/lcms/Projects/VC7/resource.h
gs/lcms/Projects/VC7/tiffdiff.vcproj
gs/lcms/Projects/VC7/tifficc.vcproj
gs/lcms/README.1ST
gs/lcms/aclocal.m4
gs/lcms/bin/Bin.txt
gs/lcms/compile
gs/lcms/config.guess
gs/lcms/config.sub
gs/lcms/configure
gs/lcms/configure.ac
gs/lcms/depcomp
gs/lcms/doc/LCMSAPI.TXT
gs/lcms/doc/TUTORIAL.TXT
gs/lcms/filter.c
gs/lcms/include/Makefile.am
gs/lcms/include/Makefile.in
gs/lcms/include/icc34.h.in
gs/lcms/include/lcms.h
gs/lcms/install-sh
gs/lcms/install.gcc
gs/lcms/jpegicc/Makefile.am
gs/lcms/jpegicc/Makefile.in
gs/lcms/jpegicc/iccjpeg.c
gs/lcms/jpegicc/iccjpeg.h
gs/lcms/jpegicc/jpegicc.1
gs/lcms/jpegicc/jpegicc.c
gs/lcms/jpegicc/makefile.simple
gs/lcms/lcms.pc.in
gs/lcms/ltmain.sh
gs/lcms/makefile.simple
gs/lcms/matlab/icctrans.c
gs/lcms/matlab/icctrans.matlab.pdf
gs/lcms/missing
gs/lcms/mkinstalldirs
gs/lcms/python/Makefile.am
gs/lcms/python/Makefile.in
gs/lcms/python/lcms.i
gs/lcms/python/lcms.py
gs/lcms/python/lcms_wrap.cxx
gs/lcms/python/swig_lcms
gs/lcms/python/testbed/AdobeRGB1998.icc
gs/lcms/python/testbed/cam02.py
gs/lcms/python/testbed/cam97.py
gs/lcms/python/testbed/clamp.py
gs/lcms/python/testbed/constant.py
gs/lcms/python/testbed/createmsh.py
gs/lcms/python/testbed/gamma.py
gs/lcms/python/testbed/info.py
gs/lcms/python/testbed/lab2adobe.py
gs/lcms/python/testbed/sRGB Color Space Profile.icm
gs/lcms/python/testbed/sRGB2adobe.py
gs/lcms/python/testbed/srgb2lab.py
gs/lcms/python/testbed/srgb2xyz.py
gs/lcms/python/testbed/virtprf.py
gs/lcms/python/testbed/whtpnt.py
gs/lcms/samples/Makefile.am
gs/lcms/samples/Makefile.in
gs/lcms/samples/icc2ps.1
gs/lcms/samples/icc2ps.c
gs/lcms/samples/icclink.1
gs/lcms/samples/icclink.c
gs/lcms/samples/icctrans.1
gs/lcms/samples/icctrans.c
gs/lcms/samples/itufax.c
gs/lcms/samples/makefile.simple
gs/lcms/samples/mkcmy.c
gs/lcms/samples/mkgrayer.c
gs/lcms/samples/mktiff8.c
gs/lcms/samples/vprf.c
gs/lcms/samples/wtpt.1
gs/lcms/samples/wtpt.c
gs/lcms/samples/xgetopt.c
gs/lcms/src/Makefile.am
gs/lcms/src/Makefile.in
gs/lcms/src/cmscam02.c
gs/lcms/src/cmscam97.c
gs/lcms/src/cmscgats.c
gs/lcms/src/cmscnvrt.c
gs/lcms/src/cmserr.c
gs/lcms/src/cmsgamma.c
gs/lcms/src/cmsgmt.c
gs/lcms/src/cmsintrp.c
gs/lcms/src/cmsio0.c
gs/lcms/src/cmsio1.c
gs/lcms/src/cmslut.c
gs/lcms/src/cmsmatsh.c
gs/lcms/src/cmsmtrx.c
gs/lcms/src/cmsnamed.c
gs/lcms/src/cmspack.c
gs/lcms/src/cmspcs.c
gs/lcms/src/cmsps2.c
gs/lcms/src/cmssamp.c
gs/lcms/src/cmsvirt.c
gs/lcms/src/cmswtpnt.c
gs/lcms/src/cmsxform.c
gs/lcms/src/cmsxform.c.orig
gs/lcms/src/cmsxform.h
gs/lcms/src/lcms.def
gs/lcms/src/makefile.simple
gs/lcms/testbed/Makefile.am
gs/lcms/testbed/Makefile.in
gs/lcms/testbed/makefile.simple
gs/lcms/testbed/sRGB Color Space Profile.icm
gs/lcms/testbed/sRGBSpac.icm
gs/lcms/testbed/testcms.c
gs/lcms/tifficc/Makefile.am
gs/lcms/tifficc/Makefile.in
gs/lcms/tifficc/getopt.c
gs/lcms/tifficc/makefile.simple
gs/lcms/tifficc/tiffdiff.c
gs/lcms/tifficc/tifficc.1
gs/lcms/tifficc/tifficc.c
gs/psi/msvc.mak


2014-09-25 11:21:14 +0100
Chris Liddell <chris.liddell@artifex.com>
6ecc8536f5119f21aa38b94eb00e61214d27bd62

Bug 695502: segfault with -dBGPrint=true

When we're doing background printing, and we're using a memory file based
clist, we create a "clone" of the file object with it's own "context" but
which shares the underlying "raw" data with the original file. The original
code tries to free the underlying raw data memory along with the clone
file object, but as the clone uses the memory allocator created for the
rendering thread and the raw data memory was allocated in the interpretation
"thread", we end up trying to free memory to the wrong allocator.

This commit has the interpreter thread hold a reference to the original clist
files, so we can free the "clone" files with the thread allocator, and the
original file with the allocator from the interpreter thread. As both these
cleanup actions happen in the interpreter thread, we don't have to worry about
thread clashes.

No cluster differences.

gs/base/gdevprn.c
gs/base/gdevprn.h
gs/base/gxclthrd.c


2014-09-17 21:17:14 +0100
Chris Liddell <chris.liddell@artifex.com>
7ac0f1668fca8e1ca343e02f55faa7dd9f23d549

Bug 695483: BGPrint seg fault

When reading params for the existing device, to pass to the cloned device,
use the thread_memory rather than the original device memory.

And move the io_device_table into immovable memory, rather than regular gc
memory.

No cluster differences.

gs/base/gsiodev.c
gs/base/gxclthrd.c


2014-09-29 08:57:14 +0100
Chris Liddell <chris.liddell@artifex.com>
68aa4cb52359c0c6e25bcf53735bb05030ee4a2b

Fix typo in LICENSE file

CLUSTER_UNTESTED

gs/LICENSE


2014-09-27 15:21:01 +0100
Ken Sharp <ken.sharp@artifex.com>
d5ecb99d3641a95803c88e6df2f734d392a3be63

Make DCT filter finalize routine robust against double calling.

Bug #695542 "Crash on EPS on Mac and Linux"

The problem is that we close a DCT filter inside a gsave context, while
the file ref is still pointing at it.

When the PostScript 'close' operator closes the DCT filter, we free the
memory associated with the stream state in the finalize routine. But the
PostScript file ref is still pointing at it, and when we grestore, the
finalize routine gets called again. Because the routine doesn't check for
NULL pointers before freeing, and indeed doesn't NULL the pointers after it
does free them, this leads to us freeing memory which has already been
freed.

Apparently we've already fixed a number of similar problems in finalize
routines, probably caused by people not realising a finalize routine could
(surprisingly) be called more than once.

In this commit we set the pointers to null after feeing the memory, and
check for null pointers before attempting to free the memory, and before
attempting to dereference any pointers.

No differences expected.

gs/base/sdctc.c
gs/base/stream.c


2014-09-27 09:05:54 +0100
Chris Liddell <chris.liddell@artifex.com>
9ef2c8188a86c5e19c93a38bb01b9297200bd896

Bug 695543 - gs %stdin segfaults

In zopen_file() when we're opening a Postscript device, ensure that we set the
"state" entry in the iodev structure before calling the device specific "open"
method - as we do elsewhere in the same circumstances. That is required to
properly access devices like "%stdin" and co.

No cluster differences.

gs/psi/zfile.c


2014-09-26 09:56:40 +0100
Chris Liddell <chris.liddell@artifex.com>
97ee68c17fd8709b4509b394b721524b7777c3bb

Bug 695539: glyph mapping - handle "missing" codepoints

When extending the glyph mapping in a font, the original code for adding the
codepoint to the font could assume the codepoint was valid as it was always
read from the Adobe Glyph List. But I added code to "parse" a codepoint from
the special "uniXXXX" type names, and that breaks that assumption.

Handle the case where we reach that point with codepoint that doesn't exist in
the AGL.

No cluster differences.

gs/Resource/Init/gs_ttf.ps
gs/Resource/Init/gs_type1.ps


2014-09-25 23:42:50 -0600
Henry Stiles <henry.stiles@artifex.com>
0c677ef110bb53460062da7586e37a37ea6eae52

Fix Bug #695535 Page not cleared upon resolution setting.

Somewhat puzzling this hasn't come up before but PCL was changing the
resolution of a PCL job upon receiving a PJL command without erasing
the page. If the resolution is set on the command line or the device
default is used the normal page erasing happens with the job's
resolution already set.

pcl/pcjob.c
pcl/pcl.mak


2014-09-25 09:47:14 -0700
Ray Johnston <ray.johnston@artifex.com>
53d8252202f860398be69a59d6a6da80aca551ce

Fix typo when closing bfile and cfile. Thanks to Norbert Janssen.

gs/base/gxclthrd.c


2014-09-23 07:47:00 -0700
Ray Johnston <ray.johnston@artifex.com>
75a183ff51daebf8c3835f3d6e5107d70061a8ce

Change the -Z: output to report parse done as well as page render done.

This corresponds more closely the the information available with -Z: from
gs which provides Outputpage start and Outputpage end times. This is useful
for the 'overview' timing analysis, such as with bug 695374.

pcl/pctop.c
pl/plmain.c


2014-09-23 09:18:46 +0100
Ken Sharp <ken.sharp@artifex.com>
98b066aad13281ce75471163959db727a5a9da58

pdfwrite - fix a warning and an assignment to conditional

Removing the assignment of a return value to code in order to eliminate a
compiler warning.

The test of code against gs_error_interrupt was accidentally written as an
assignment, fixing this causes progressions in:
Bug690534.pdf
586_-_missing_images_gs_SMask_not_applied.pdf
multiply_luminosity_masks_ignored.pdf

These are progressions over 9.15 as well.

gs/devices/vector/gdevpdft.c


2014-09-08 14:47:15 +0100
Chris Liddell <chris.liddell@artifex.com>
2454c0d599f3abdff7d7b002d54dd58549e948de

Update docs, versions and dates for release candidate.

Update docs, dates etc for second release candidate.

Update stuff for release

gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2014-09-22 16:08:37 +0100
Ken Sharp <ken.sharp@artifex.com>
fd5858999c4117ef16f8127497bcc329e4006833

accidentally left a line out of ee3d09

Due to finger trouble, missed this line off the last commit

gs/devices/vector/gdevpdft.c


2014-09-22 16:06:01 +0100
Ken Sharp <ken.sharp@artifex.com>
ee3d09d4efed339d15d6168f3ef72516d3391576

pdfwrite - handle transparency mask of type TRANSPARENCY_MASK_None

Bug #695482 "Regression: empty PDF files written starting with ea6290b302598f13e7fb4c29aff73657989e693d"

commit ea6290b302598f13e7fb4c29aff73657989e693d introduced this type of
transparency mask, which is *not* concluded with an end transparency group.
Because pdfwrite didn't expect this, it led to 0 length output PDF files.

This commit restores the functionality, it does not (apparently) produce
correct output from the test file using pdfwrite though.

The differences here are all progressions.

gs/devices/vector/gdevpdft.c


2014-09-22 14:34:55 +0100
Ken Sharp <ken.sharp@artifex.com>
a1a6d76aae77b28bfd805f06df4a1a9537fbc139

remove some C++ comments (and some other commented code)

gs/devices/vector/gdevpdte.c


2014-09-22 13:28:50 +0100
Ken Sharp <ken.sharp@artifex.com>
37837c01c7ca8461e9f458c061e27990dd94ad41

remove an unused variable to silence a compiler warning

gs/devices/gxfcopy.c


2014-09-22 10:42:29 +0100
Ken Sharp <ken.sharp@artifex.com>
202b0d827c4840410d01a6acb83c56277829f507

pdfwrite - close dangling substreams at end of page

Inspired by bug #695482 but not intended as a fix, and also by bug #695354

If we fail to close a substream (possibly because the PDF interpreter throws
an error) then this leaves a text_state associated with the substream
dangling, and potentially referencing other freed memory which can lead
to a crash in the garbage collector. In addition we can end up writing an
empty PDF file.

This commit closes any substreams which are still open when a page is written
which ensures the memory is cleaned up, and that a valid (if broken) PDF
file gets written.

Note that ps2write is (of course) different, and *expects* to have a substream
open at the end of the page, so in this case we have to close the page and then
clean up any dangling substreams afterwards.

Although this appears to 'fix' bug #695482 its not a proper fix.

No differences expected.

gs/devices/vector/gdevpdf.c


2014-09-22 08:51:23 +0100
Ken Sharp <ken.sharp@artifex.com>
9e5c21512649090ae563b584caec32fb6fdc2bb9

pdfwrite - free associated text state when closing a substream

When we open a substream, we create a text state, but we did not prevoously
free the text state when closing the substream, which could lead to memory
leaks or if using the '%d' syntax for per-page PDF output, could lead to
crashes in the garbage collector.

No differences expected

gs/devices/vector/gdevpdti.c


2014-09-22 08:49:39 +0100
Ken Sharp <ken.sharp@artifex.com>
1cd582c342d1d754d85f5d89f39cbe672b9d9c67

pdfwrite - free FDArray from copied CIDFOnts when copy is freed

further to commit 26a22e which freed copied descendant fonts from a copy of
a CIDFont when it was freed, here we free the FDArray itself from teh copy.

No differences expected

gs/devices/gxfcopy.c


2014-09-19 13:38:25 +0100
Ken Sharp <ken.sharp@artifex.com>
26a22e6fd3dd42fdcaae568276f82b40d746bce9

Free copied descendant font(s) when freeing a copied CIDFont

When we copy a CIDFont (other than a TrueType CIDFont) we also copy the
descendant fonts. But when we free them (gs_free_copied_font) we only free
the CIDFont, leaving the descendants dangling. This can cause problems
(seg fault) when we garbage collect the descendants.

Here we free the descendants as well. This is complicated by the fact that
the parent CIDFont 'glyphs' space is shared by all the descendants, so
we *don't* want to free that when we free the descendant.

No differences expected

gs/devices/gxfcopy.c


2014-09-17 14:02:17 +0100
Chris Liddell <chris.liddell@artifex.com>
bb35d2d7bc93b1fff5e182be370d64b24129a09e

Bug 695490: GL stick font seg fault

Initialise width cache values for stick font and 531 font.

No cluster differences.

pcl/pglabel.c


2014-09-17 13:46:17 +0100
Chris Liddell <chris.liddell@artifex.com>
d4c1bd25347e42d0668a73a57bd9aa8ca904be1a

Bug 695491: parallel make fail due to pconfig.h

Create a target for pconfig.h and have it as a dependency where required,
rather than have each individual target that needs it copy pconf.h to
pconfig.h which could cause a "collision" during a parallel build.

No cluster differences.

pcl/pcl.mak
pl/pl.mak
psi/psi.mak
pxl/pxl.mak
xps/xps.mak


2014-09-17 12:23:05 +0100
Chris Liddell <chris.liddell@artifex.com>
ec56638c8cc6176c2ee935a7ba43cd0af2a02fd1

Bug 695492: fix seg fault regression with '-h'

When called with the '-h' parameter, we don't fully initialise the PS
interpreter. In which case, we shouldn't try to use the PS interpreter
when we shut down.

No cluster differences.

gs/psi/imain.c


2014-09-15 19:33:32 -0700
Ray Johnston <ray.johnston@artifex.com>
b66f287128616340b68243bf5384acac066db561

Fix colors for -sDEVICE=bitrgb -dGrayValues=16

This device was using the default, but that code was encoding the
color as 5x5x5 RGB since the bit device selects a color_info.depth
of 16. Import the logic and fix it for the 4-bit RGB case (12-bit
values in 16-bit pixels).

gs/devices/gdevbit.c


2014-09-15 17:51:56 -0700
Ray Johnston <ray.johnston@artifex.com>
10d517b4954e5adaaf7cc8d823db68e8e1b157f3

Fix the -dRGB option to work with BITS = 1, 2, 4 or 8

Note that the -sDEVICE=bitrgb -dGrayValues=16 was broken due to
improper encoding. This will be fixed in a separate commit.

gs/lib/viewraw.ps


2014-09-15 08:59:08 -0700
Ray Johnston <ray.johnston@artifex.com>
eb486a42382152c5d7448eabfa7e7a40f8226c81

Improvements for viewraw.ps with RGB input for 1 and 2 bpc.

Note BITS=4 is still not supported.

gs/lib/viewraw.ps


2014-09-16 14:01:36 +0100
Ken Sharp <ken.sharp@artifex.com>
2e619c7a51e45c05c3d02792c3353b3c731f3884

pdfwrite - mark freshly opened device as 'open'

When using the '%d' format for output files, the pdf_output_page() routine
closes and reopens the pdfwrite device (to flush the device, creating
a PDF file). However, it doesn't mark the 'is_open' member of the device,
and pdfwrite doesn't do that itself, relying on the caller (normally
gs_opendevice()) to set the flag.

Later we get a setpagedevice, this executes .setdevice which calls
gs_setdevice_no_erase() which checks dev->is_open and if it is not open
then it opens it. This causes pdf_open to allocate all kinds of new
memory areas, without freeing the old ones, as well as temporary files and
possibly other structures/memory allocations.

Surprisingly this doesn't actually seem to cause a problem, but its not
right, and surely will cause problems one day, its definitely causing
memory leaks in non-GC interpreters.

So this tiny commit just sets the flag is_open when we open the device in
pdf_output_page.

No differences expected

gs/devices/vector/gdevpdf.c


2014-09-15 11:02:09 +0100
Chris Liddell <chris.liddell@artifex.com>
d0816120fdae4e9592269d98e933cbdf99faad5e

Bug 695483: disable BGPrint before we shutdown interpreter

Before we start the process of shutting down the PS interpreter, disable BGPrint
(and set NumRenderingThreads to 0, just for safety). If we don't do this, the
"parent" rendering thread will continue preparations for the next page whilst
we shutdown the interpreter, and will thus attempt to access some objects
subject to garbage collection (such as the I/O device table).

Additionally, when a device switches from BGPrint enabled to disabled, make sure
we tear down the rendering thread(s) and get rid off the BGPrint related data.

No cluster differences.

gs/base/gdevprn.c
gs/psi/imain.c


2014-09-15 10:21:18 +0100
Chris Liddell <chris.liddell@artifex.com>
0d22694c3798bf13120be35322b7984fd2296e0f

Bug 695486: initialise c_alone in current chunk (cc)

When we (re-)initialise an allocator, we have to initialise the contents of the
current chunk (cc) entry - initialise to "false" since that's the common case.

No cluster differences.

gs/base/gsalloc.c


2014-09-15 15:19:46 +0100
Ken Sharp <ken.sharp@artifex.com>
a7b8c4f39f0f8f1f0872c2ae8faff1ddd35cbdb2

pdfwrite - free pdfwrite's 'complete' font copy if required

Bug #695484 "Regression: seg fault with debug build in pdfwrite starting with ceb5e2f006bf554a56701ee2f2c228841b324a4b"

The problem was caused because pdfwrite can maintain two copies of a font,
a subset and a complete copy, depending on settings. We were properly freeing
the subset, but not the complete copy.

This has been a long-standing undetected memory leak, but only on systems
without garbage collection, because the copied font is subject to GC, and
indeed this was causing the actual fault. When we restored at the end of the
file, the copied font was garbage collected, which caused it to try nd free
any glyphs from its font cache. But the font cache is now (since the commit
in the bug title) pointing at the pdfwrite font cache, and that has already
been freed before we get to the end of job restore, resutling in a seg fault.

Here we free the complete font copy if one has been allocated.

No differences expected.

gs/devices/vector/gdevpdtd.c


2014-09-14 23:00:08 -0600
Henry Stiles <henry.stiles@artifex.com>
0614577faa0b89574b0d9c6c9cabe77398183a40

Fix Bug 695481 - Barcode font scaled incorrectly.

The downloaded font in this file (the barcode) used the typeface
family designation of 0 which is reserved for the lineprinter font.
Our interpreter scales lineprinter specially and identifies
lineprinter with its typeface number (0), thus the barcode font was
scaled as if it were the lineprinter font. Now we check the typeface
number is 0 and the font is internal which will uniquely identify the
lineprinter font and not confuse other fonts with it.

Technically the font is broken and shouldn't be accepted, the typeface
family numbers documented by HP should not be reused by downloaded
fonts, but HP printers seem to print the job.

pcl/pctext.c


2014-09-12 14:49:08 +0100
Chris Liddell <chris.liddell@artifex.com>
94786ac00b285be997aaddbc689180478a47e270

Get rid of last vestiges of pswrite....

Remove epswrite (the final "subdevice" of pswrite) and references to it.

Also remove the gdevps.c source file.

Cluster differences only in files that enumerate the devices list, for
example:
430-01.ps

doc/who_owns_what.txt
gs/Makefile.in
gs/base/macos-mcp.mak
gs/base/macosx.mak
gs/base/openvms.mak
gs/base/openvms.mmk
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/configure.ac
gs/devices/devs.mak
gs/devices/vector/gdevps.c
gs/lib/eps2eps
gs/lib/eps2eps.bat
gs/lib/eps2eps.cmd
gs/man/ps2ps.1
gs/psi/msvc.mak
gs/psi/os2.mak
gs/toolbin/pre.chk


2014-09-10 11:57:10 -0700
Ray Johnston <ray.johnston@artifex.com>
ea6290b302598f13e7fb4c29aff73657989e693d

Fix Bug 695471, cust 532. /SMask /None did not remove prior SMask

The 'gssmask' proc in pdf_draw.ps doesn't remove a previous SMask
when the ExtGState is set to /SMask /None. Change the logic to
issue a "dummy" .begintransparencymaskgroup (that does NOT have a
corresponding .endtransparencymask) and add handling for this type
of SMask in the code. This does not result in a colorspace change,
but only frees the tos maskbuf. Seen with MSN_Chrome.pdf

gs/Resource/Init/pdf_draw.ps
gs/base/gdevp14.c
gs/base/gstparam.h
gs/base/gstrans.c


2014-08-27 10:08:45 -0700
Ray Johnston <ray.johnston@artifex.com>
3b2d19e8a459610ba50560ee004eae8736644dc1

Add lib/viewraw.ps utility to view "raw" files

An extended version of lib/viewcmyk.ps so that "raw" output from
bit, bitrgb or bitcmyk can be displayed or converted. For example:
gswin32c -sDEVICE=bitrgb -dGrayValues=256 -o x.rgb examples/tiger.eps
can be viewed with:
gswin32c -dRGB -dBITS=8 -- lib/viewraw.ps x.rgb 612

gs/lib/viewraw.ps


2014-09-08 13:52:07 +0100
Chris Liddell <chris.liddell@artifex.com>
fcb0c5ee27b9d5a769545f547ee7afdcf8e9829f

Bump version.

Usual cluster differences.....

gs/Resource/Init/gs_init.ps
gs/base/version.mak


2014-09-22 11:12:44 +0100
Chris Liddell <chris.liddell@artifex.com>
8b2e4263a230d0e7cb262532e0f347976f4b289a

Update stuff for release

gs/base/gscdef.c
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2014-09-17 12:23:05 +0100
Chris Liddell <chris.liddell@artifex.com>
404e71e01ad665deb7435fe37aad6034380297e3

Bug 695492: fix seg fault regression with '-h'

When called with the '-h' parameter, we don't fully initialise the PS
interpreter. In which case, we shouldn't try to use the PS interpreter
when we shut down.

No cluster differences.

gs/psi/imain.c


2014-09-16 11:48:12 +0100
Chris Liddell <chris.liddell@artifex.com>
96a55a20f5b0d852d2118a1ac318293c6a0f716e

Update docs, dates etc for second release candidate.

gs/base/gscdef.c
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2014-09-15 11:02:09 +0100
Chris Liddell <chris.liddell@artifex.com>
551d7dd426fe8ab7f2c0c9d90339784e2b643bad

Bug 695483: disable BGPrint before we shutdown interpreter

Before we start the process of shutting down the PS interpreter, disable BGPrint
(and set NumRenderingThreads to 0, just for safety). If we don't do this, the
"parent" rendering thread will continue preparations for the next page whilst
we shutdown the interpreter, and will thus attempt to access some objects
subject to garbage collection (such as the I/O device table).

Additionally, when a device switches from BGPrint enabled to disabled, make sure
we tear down the rendering thread(s) and get rid off the BGPrint related data.

No cluster differences.

gs/base/gdevprn.c
gs/psi/imain.c


2014-09-15 10:21:18 +0100
Chris Liddell <chris.liddell@artifex.com>
51b9c7dc2a471b9c3dfe6400c0a55d90db4fec16

Bug 695486: initialise c_alone in current chunk (cc)

When we (re-)initialise an allocator, we have to initialise the contents of the
current chunk (cc) entry - initialise to "false" since that's the common case.

No cluster differences.

gs/base/gsalloc.c


2014-09-15 15:19:46 +0100
Ken Sharp <ken.sharp@artifex.com>
fec643c7e29810c0c5381bd86ba31ff3595bc9ba

pdfwrite - free pdfwrite's 'complete' font copy if required

Bug #695484 "Regression: seg fault with debug build in pdfwrite starting with ceb5e2f006bf554a56701ee2f2c228841b324a4b"

The problem was caused because pdfwrite can maintain two copies of a font,
a subset and a complete copy, depending on settings. We were properly freeing
the subset, but not the complete copy.

This has been a long-standing undetected memory leak, but only on systems
without garbage collection, because the copied font is subject to GC, and
indeed this was causing the actual fault. When we restored at the end of the
file, the copied font was garbage collected, which caused it to try nd free
any glyphs from its font cache. But the font cache is now (since the commit
in the bug title) pointing at the pdfwrite font cache, and that has already
been freed before we get to the end of job restore, resutling in a seg fault.

Here we free the complete font copy if one has been allocated.

No differences expected.

gs/devices/vector/gdevpdtd.c


2014-09-14 23:00:08 -0600
Henry Stiles <henry.stiles@artifex.com>
d10d0b9f9a4c11ef11f08849cf0f0f0405ada6c6

Fix Bug 695481 - Barcode font scaled incorrectly.

The downloaded font in this file (the barcode) used the typeface
family designation of 0 which is reserved for the lineprinter font.
Our interpreter scales lineprinter specially and identifies
lineprinter with its typeface number (0), thus the barcode font was
scaled as if it were the lineprinter font. Now we check the typeface
number is 0 and the font is internal which will uniquely identify the
lineprinter font and not confuse other fonts with it.

Technically the font is broken and shouldn't be accepted, the typeface
family numbers documented by HP should not be reused by downloaded
fonts, but HP printers seem to print the job.

pcl/pctext.c


2014-09-12 14:49:08 +0100
Chris Liddell <chris.liddell@artifex.com>
f4034b2aa85e685c66e98be8c31c511cd9a5169e

Get rid of last vestiges of pswrite....

Remove epswrite (the final "subdevice" of pswrite) and references to it.

Also remove the gdevps.c source file.

Cluster differences only in files that enumerate the devices list, for
example:
430-01.ps

doc/who_owns_what.txt
gs/Makefile.in
gs/base/macos-mcp.mak
gs/base/macosx.mak
gs/base/openvms.mak
gs/base/openvms.mmk
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/configure.ac
gs/devices/devs.mak
gs/devices/vector/gdevps.c
gs/lib/eps2eps
gs/lib/eps2eps.bat
gs/lib/eps2eps.cmd
gs/man/ps2ps.1
gs/psi/msvc.mak
gs/psi/os2.mak
gs/toolbin/pre.chk


2014-08-27 10:08:45 -0700
Ray Johnston <ray.johnston@artifex.com>
bbe97e4cfc3d725f42ae34125c716902faf72977

Add lib/viewraw.ps utility to view "raw" files

An extended version of lib/viewcmyk.ps so that "raw" output from
bit, bitrgb or bitcmyk can be displayed or converted. For example:
gswin32c -sDEVICE=bitrgb -dGrayValues=256 -o x.rgb examples/tiger.eps
can be viewed with:
gswin32c -dRGB -dBITS=8 -- lib/viewraw.ps x.rgb 612

gs/lib/viewraw.ps


2014-09-08 14:47:15 +0100
Chris Liddell <chris.liddell@artifex.com>
540a228f026bf3abd288d5e88a7ef74345600380

Update docs, versions and dates for release candidate.

gs/base/gscdef.c
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1



Version 9.15 (2014-09-22)

This is the eleventh full release in the stable 9.x series, and is primarily a maintenance release.

Highlights in this release include:

For a list of open issues, or to report problems, please visit bugs.ghostscript.com.

Incompatible changes

No recorded incompatible changes.

Changelog

2014-09-08 09:36:19 +0100
Chris Liddell <chris.liddell@artifex.com>
551d7dd426fe8ab7f2c0c9d90339784e2b643bad

Bug 695483: disable BGPrint before we shutdown interpreter

Before we start the process of shutting down the PS interpreter, disable BGPrint
(and set NumRenderingThreads to 0, just for safety). If we don't do this, the
"parent" rendering thread will continue preparations for the next page whilst
we shutdown the interpreter, and will thus attempt to access some objects
subject to garbage collection (such as the I/O device table).

Additionally, when a device switches from BGPrint enabled to disabled, make sure
we tear down the rendering thread(s) and get rid off the BGPrint related data.

No cluster differences.

gs/base/gdevprn.c
gs/psi/imain.c


2014-09-15 10:21:18 +0100
Chris Liddell <chris.liddell@artifex.com>
51b9c7dc2a471b9c3dfe6400c0a55d90db4fec16

Bug 695486: initialise c_alone in current chunk (cc)

When we (re-)initialise an allocator, we have to initialise the contents of the
current chunk (cc) entry - initialise to "false" since that's the common case.

No cluster differences.

gs/base/gsalloc.c


2014-09-15 15:19:46 +0100
Ken Sharp <ken.sharp@artifex.com>
fec643c7e29810c0c5381bd86ba31ff3595bc9ba

pdfwrite - free pdfwrite's 'complete' font copy if required

Bug #695484 "Regression: seg fault with debug build in pdfwrite starting with ceb5e2f006bf554a56701ee2f2c228841b324a4b"

The problem was caused because pdfwrite can maintain two copies of a font,
a subset and a complete copy, depending on settings. We were properly freeing
the subset, but not the complete copy.

This has been a long-standing undetected memory leak, but only on systems
without garbage collection, because the copied font is subject to GC, and
indeed this was causing the actual fault. When we restored at the end of the
file, the copied font was garbage collected, which caused it to try nd free
any glyphs from its font cache. But the font cache is now (since the commit
in the bug title) pointing at the pdfwrite font cache, and that has already
been freed before we get to the end of job restore, resutling in a seg fault.

Here we free the complete font copy if one has been allocated.

No differences expected.

gs/devices/vector/gdevpdtd.c


2014-09-14 23:00:08 -0600
Henry Stiles <henry.stiles@artifex.com>
d10d0b9f9a4c11ef11f08849cf0f0f0405ada6c6

Fix Bug 695481 - Barcode font scaled incorrectly.

The downloaded font in this file (the barcode) used the typeface
family designation of 0 which is reserved for the lineprinter font.
Our interpreter scales lineprinter specially and identifies
lineprinter with its typeface number (0), thus the barcode font was
scaled as if it were the lineprinter font. Now we check the typeface
number is 0 and the font is internal which will uniquely identify the
lineprinter font and not confuse other fonts with it.

Technically the font is broken and shouldn't be accepted, the typeface
family numbers documented by HP should not be reused by downloaded
fonts, but HP printers seem to print the job.

pcl/pctext.c


2014-09-12 14:49:08 +0100
Chris Liddell <chris.liddell@artifex.com>
f4034b2aa85e685c66e98be8c31c511cd9a5169e

Get rid of last vestiges of pswrite....

Remove epswrite (the final "subdevice" of pswrite) and references to it.

Also remove the gdevps.c source file.

Cluster differences only in files that enumerate the devices list, for
example:
430-01.ps

doc/who_owns_what.txt
gs/Makefile.in
gs/base/macos-mcp.mak
gs/base/macosx.mak
gs/base/openvms.mak
gs/base/openvms.mmk
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/configure.ac
gs/devices/devs.mak
gs/devices/vector/gdevps.c
gs/lib/eps2eps
gs/lib/eps2eps.bat
gs/lib/eps2eps.cmd
gs/man/ps2ps.1
gs/psi/msvc.mak
gs/psi/os2.mak
gs/toolbin/pre.chk


2014-08-27 10:08:45 -0700
Ray Johnston <ray.johnston@artifex.com>
bbe97e4cfc3d725f42ae34125c716902faf72977

Add lib/viewraw.ps utility to view "raw" files

An extended version of lib/viewcmyk.ps so that "raw" output from
bit, bitrgb or bitcmyk can be displayed or converted. For example:
gswin32c -sDEVICE=bitrgb -dGrayValues=256 -o x.rgb examples/tiger.eps
can be viewed with:
gswin32c -dRGB -dBITS=8 -- lib/viewraw.ps x.rgb 612

gs/lib/viewraw.ps



Ken Sharp <ken.sharp@artifex.com>
8605f67582ae2e2e619ab6fbab9888a23f37fdb9

pdfwrite - tidy up some compiler warnings

No effect, just silences the compiler or scan-build.

gs/devices/vector/gdevpdfp.c
gs/devices/vector/gdevpsdp.c


2014-09-04 14:49:21 +0100
Chris Liddell <chris.liddell@artifex.com>
b4c9acd0ca532d19421fdf83aa9ad71895fad753

Remove the uproduct and co targets.

Replaced (for now) with a brief message about being unsupported, and to use
configure --with-ufst=<>

No cluster differences.

Makefile


2014-09-04 14:34:58 +0100
Chris Liddell <chris.liddell@artifex.com>
91e8954e01996853ce6dc1318465c7b55e9d1f90

Better mkromfs support for cross compile

When cross compiling between platforms of differening endianness, mkromfs will
now create output usable on the target architecture.

No cluster differences.

gs/base/mkromfs.c


2014-09-04 14:31:25 +0100
Chris Liddell <chris.liddell@artifex.com>
bfeeadc3d534cb01fe6dd3bfb21a0af1e55b0a48

Tweak "search" for default CID fallback font.

Fix an issue where the default fallback font could not be found if the
GenericResourceDir was a relative path.

No cluster differences.

gs/Resource/Init/gs_cidtt.ps


2014-09-05 15:03:05 +0100
Ken Sharp <ken.sharp@artifex.com>
201ff60b950912c09d22b3b4ed0b57ed75c3587a

pdfwrite - consume Distiller params even when LockDistillerparams is true

Bug #695468 "/rangecheck in .installpagedevice error when combining LockDistillerParams, setpagedevice, and restore"

Previously when LockDistillerParams was true the distiller param parsing
code did not get called. This left the Distiller parameter key/value
pairs 'untouched' in the parameter list.

Ordinarily this is not a problem, but .installpagedevice, which is called
during restore to reset the page device parameters, insists that all keys
must be consumed and throws an error if they are not.

This patch alters the distiller parameter parsing to read all the parameters
no matter what the setting of LockDisillerParams. The values are read into
a dummy parameter structure, when complete they are either copied back to
the real structure or, if LockDistillerParams is set, discarded. If we
discard the parameters we clean up the memory rather than relying on garbage
collection to do it for us.

I don't think the pdfwrite device currently does this when the device is
closed, which would be a memory leak, if we ever decide we need to address
this then we can use the code here.

No differences expected.

gs/devices/vector/gdevpdfp.c
gs/devices/vector/gdevpsdp.c


2014-09-04 13:16:48 +0100
Ken Sharp <ken.sharp@artifex.com>
ce3445892ca6094a5c681667b1ecc1aa07c87254

Improved form handling of clip areas

Bug #695307 "Preservation of PostScript form elides form content"

When a device (such as pdfwrite) hands back a matrix to set as the CTM
(pdfwrite does this to capture the form unscaled), we need to account for
that CTM when we reset the clip, otherwise we can end up clipping content.

Also, rather than using +/- page boundaries, we use +/- the form BBox.

This shows 2 minor progressions in the test suite.

gs/psi/zform.c


2014-09-02 15:27:25 +0100
Ken Sharp <ken.sharp@artifex.com>
ceb5e2f006bf554a56701ee2f2c228841b324a4b

Address leaking font cache in PCL interpreter

Bug #695017 "pcfont_do_reset() leaks memory"

The PCL interpreter should free its font cache on exit, but it does not.
This is because of the fact that when we copy fonts the font cache of the
original font is copied to the font cache of the copied font. Later, when
a high level device wants to retrieve glyph information, the font code
uses the font cache from the copied font.

This doesn't immediately seem like a problem, it seems like we should be
able to defer freeing the font cache until after we've closed the device,
and that would satisfy pdfwrite. However, the way that PCL 'passthrough'
works, the PCL interpreter can be run 'inside' the PXL interpreter. If we
free the PCL interpreter font cache when it exits then pdfwrite has font
copies which are still pointing at the freed font cache.

We did discuss having the PCL/PXL interpreter set the gs_lib_ctx font_dir
(it currently dos not do so) and having pdfwrite set the font cache of the
fonts it copies use that, instead of the font cache from the original font.
But this seemed to me likely to run into the possibility of the same problem
recurring in future.

Instead, we have pdfwrite create and maintain its own font cache. When pdfwrite
copies a font it replaces the font cache pointer (which is initially the same
as the original font) with the new pdfwrite-specific font cache.

This means that any interpreter can free its font cache and pdfwrite will
still be able to use its own font cache when retrieving glyph information.

This commit includes both the changes to pdfwrite to enable the new font cache
and the changes to the PCL/PXL interpreter to free the font cache when the
interpreter is done with it.

No differences expected.

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfx.h
gs/devices/vector/gdevpdtb.c
pcl/pcfont.c


2014-09-02 09:40:20 +0100
Chris Liddell <chris.liddell@artifex.com>
884b9e456336b1fd7ddb3c50726be5469159421a

Bug 695235: off-by-one error in trio

Tweak to deal with off-by-one errors due to casting of doubles in trio.

No cluster differences.

gs/trio/trio.c


2014-08-29 17:19:58 +0100
Chris Liddell <chris.liddell@artifex.com>
c670fd6b0852aa057103632630bab81c9317b613

Tweak the libtiff configure invocation to use relative paths.

No cluster differences.

configure.ac
gs/configure.ac


2014-08-29 16:05:38 +0100
Chris Liddell <chris.liddell@artifex.com>
d0c3d8e6b0f5ce246ad5e3d08b1628b529f99582

Add quoting around paths for libtiff configure.

No cluster differences.

configure.ac
gs/configure.ac


2014-08-28 10:09:41 +0100
Ken Sharp <ken.sharp@artifex.com>
3ff453592e3ae6d98a640047765a5baf1e345964

More work with setpagedevice

commit 55bd0a59caf26a59f852e2dec5b76ad399d9408b fixed the problems with
RedValues and friends, but at the cost of preventing these keys being set
by setpagedevice.

This commit allows them to be set by creating a 'write only' dictioanry
whose keys are removed from the initial device dictionary before we make it
read-only and send it to setpagedevice.

See the comments in the commit for further details.

No differences expected.

gs/Resource/Init/gs_setpd.ps


2014-08-27 14:45:33 +0100
Ken Sharp <ken.sharp@artifex.com>
55bd0a59caf26a59f852e2dec5b76ad399d9408b

Fix setpagedevice so that changing ProcessColorModel works

Bug #695439 "Reference to free memory, or segfault with release build"

The problem is the horrendous way our implementation of setpagedevice works.
Where we should query the device for its parameters, our implementation
maintains a dictionary (initially built by querying the device) which is
updated by calls to setpagedevice.

Clearly at some time in the past someone has discovered that this breaks
badly if the device changes a parameter itself, as this won't be reflected
in the saved dictionary. So the '.dynamicppkeys' dictionary was defined,
whose sole purpose is to hold a list of keys whose values must be refreshed
from the device.

However, this dictionary is *also* used to prevent those same keys being
sent to the device.....

This means that commit 2eda51b48c7e97adf7c46fc3d7eb34fcdf6061e6 prevented
any changes to OutputICCProfile being sent to the device.

So I've now made 2 dictionaries with separate purposes, one is for 'read only'
keys which should not be sent to the device, and one which contains the list
of keys which must be read back from the device to replace the stored values
in our dictionary. Keys may appear in both, either, or neither.

The problem in this bug is that we create our initial dictionary when the
device is in DeviceRGB, and we store the RedValues, GreenValues, BlueValues
and GrayValues from the device in our stored dictionary. Then we execute
code to change the ProcessColorModel to DeviceGray. This alters the values
of the RedValues etc in the device. But these are *not* copied into our
stored dictionary. Later we call .installpagedevice which does not change
the ProcessColorModel, but does attempt to set the RedValues etc, which are
invalid for a DeviceGray ProcessCOlorModel, leading to a rangecheck.

I had hoped that adding these keys to the volatile dictionary would be
sufficient to fix the problem, but it seems that we don't update our stored
dictionary with these parameters. The only way to fix this turned out to be
to add the keys to the 'read only keys' dictionary so that we don't try and
send them to the device.

I'm not completely sure this is sensible, it isn't obvious to me what these
values are for, so I can't be certain that they should become 'read only'.
However, its the simplest way to solve this problem.

Of course the right way to fix this is to change our horrible setpagedevice
code so that it works the way the spec says it should.

The fix described above resolves the memory warning for me as well.

No differences expected.

gs/Resource/Init/gs_setpd.ps


2014-08-25 15:16:13 +0100
Ken Sharp <ken.sharp@artifex.com>
5ce2fca754b4ba5bce4194bae382ef1d46abaf00

pdfwrite - fix handling of Tx fields in AcroForms

Bug #695438 "AcroForm text fields not being rendered"

There are multiple parts to this fix.

1) Alter the default of the NeedAppearances key in AcroForms and AcroForm
field dictionaries to true so that if its not present we will generate
Appearances for fields which have none. (we still won't generate them if
the field is present and set to false, though Acrobat does)

2) Fix the Length key of the Form dictionary we generate for Tx fields,
previously it was set to 0, so the form wasn't ever executed.

3) If there is no 'V' key in the Field dictionary for a Tx field, use the
/DV key instead. If still no key then use an empty string.

These changes uncovered some interesting additional problems.

1) Bug687498 has an AcroForm with a Tx field, declared as multiline, where
the actual data is an empty string. Now that we actually execute the Form
this causes an error. Add a check to treat strings with less than 2 bytes
as single line, so that splitstring doesn't throw an error.

2) Bug692477.pdf, now that we default 'NeedAppearances' to true, we discover
that this file has a Fields array where every element is the null object,
which causes errors trying to extract dictionary key/value pairs from it.
Add a check to see that the Field element is a dictionary, and ignore it if
it isn't.

No differences expected, we don't test with -dShowAcroForm

gs/Resource/Init/pdf_draw.ps
gs/Resource/Init/pdf_main.ps
gs/Resource/Init/pdf_ops.ps


2014-08-20 08:54:16 -0700
Ray Johnston <ray.johnston@artifex.com>
2eda51b48c7e97adf7c46fc3d7eb34fcdf6061e6

Bug 695420: Bad pointer to OutputICCProfile string.

This was caused by the gs_setpd.ps logic having a dictionary that has the
OutputICCProfile pointing to dev->icc_struct->device_profile[0]->name, but
when ColorConversionStrategy distillerparam is set, it does a rc_decrement
on the pdev->icc_struct which frees the entire structure, among those the
'name' (which was allocated in non_gc_memory).

Add the OutputICCProfile to the list of .dynamicppkeys in gs_setpd.ps so
that the string will always be updated and the dictionary won't have a
stale pointer.

Having a dict with a string in non_gc_memory is OK I guess, even though
we generally "hide" all non_gc_memory elements from the GC.

gs/Resource/Init/gs_setpd.ps


2014-07-24 17:41:32 -0700
Ray Johnston <ray.johnston@artifex.com>
b181cc746811d2920cfe183d8fd341de944d65b3

Add a missing condition for devices that need tags to pdf14_recreate_device.

Customer 532 has done extensive testing and uses tags. This change
is in their code.

gs/base/gdevp14.c


2014-08-18 16:40:53 +0100
Ken Sharp <ken.sharp@artifex.com>
727340d4bd2a42b2793d00c3b5cd36facdf26e92

pdfwrite - fix a ShadingType 5 with array DataSource and a Function

Bug #695359 "Wrong gradients after conversion to PDF"

The example file is a hand-coded shading of type 5 with the DataSource
being an array, but using a function to convert the parametric value at
each vertex into a colour value.

The PDF specification doesn't support this kind of shading, so we need
to convert it. In doing so we write out a Decode array, which needs to contain
the minimum and maximum colour values. Ordinarily we get these from the
shading dictionary, but when using an array for DataSource this is not
present. In the absence of the Decode array we were defaulting to 0 and 1
but the function actually has a range from 0 to 10. This meant we were
truncating the colour space.

This commit examines the Function (if present) and uses the Domain of the
function as the values instead of 0 and 1.

This may not be sufficient in the absolute general case, but all mesh
shadings are rare in real world files, and mesh shadings using array
DataSource are still less common, as are examples with a function which
does not have a Domain 0-1. So this will suffice until we see more
problems.

Note that Acorbat Distiller X produces different output if you run the
two shadings in the example file separately instead of consecutively. Also
Acrobat X displays the resulting file from both Distiller and Ghostscript
incorrectly (Acrobat XI displays them correctly)

No differences expected.

gs/devices/vector/gdevpdfv.c


2014-08-18 09:15:48 +0100
Ken Sharp <ken.sharp@artifex.com>
db7668753ca114aabc4d34063876732dc043e9b8

PDF interpreter - read BPC from the JPX stream instead of the resource dict

Bug #695387 "PDF with jpeg2000 conversion problems"

The PDF spec states (table 4.39, BPX on page 340 of the PDF Rerference)
that the Bits Per Component value is to be taken from the JPX stream and
the image dictionary value should be ignored if present. We were only
reading the BPC if either that to the ColorSpace was missing from the
image dictionary.

In this commit we *always* pare the data out of the JPX stream (which is
a small performance penalty). However, this always overwrites the data in
the resource dictionary, which is fine for BPX< but not acceptable for the
colour space, because Acrobat favours the ColorSpace in the
image dictionary over the JPX colour space, and because we set the colour
space to be DeviceGray for softmasks.

So we save the colour space from the resource dictionary (if present), read
the BPC and colour space then, if we had a colour space in the resource
dictionary we restore it back again.

For some reason this causes problems on the cluster with the test file
Bug688845.eps. Since this change only affects JPX images, and PDF files, I
can't see any way that the change can be responsible for this. I am unable
to reproduce the problem on Windows or Linux locally.

gs/Resource/Init/pdf_draw.ps


2014-08-15 11:30:01 +0100
Chris Liddell <chris.liddell@artifex.com>
a7e8f7592a9861f83dbb94b8b545961caca864ce

Bug 694160: Prevent malicious code being injected into the system.

This is essentially the same patch as committed in:
4fc4b8410d35b193d549558ab212cc727db9460b

but that patch was missing white space at the ends of automatically
concatenated strings - hence the interpreter saw, for example:
".systemexecend" rather than ".systemexec end".

Additionally, to avoid that confusion in the future, I've removed the reliance
on the automatic string concatenation.

Also removed a spurious additional call to ".uninstallpagedevice".

No cluster differences.

gs/Resource/Init/gs_init.ps
gs/psi/imain.c


2014-08-15 10:14:36 +0100
Ken Sharp <ken.sharp@artifex.com>
1db534ed2b1277b265652d4b660b11e957a3e0bf

Revert commit 4fc4b8410d35b193d549558ab212cc727db9460b

See bug #694160 and #695420. Somehow this patch ends up leaving 'quit'
undefined at the end of job, which breaks the '-o' switch. It also somehow
manages to break at least some pdfwrite incantations, leading to an undefined
error with a garbage caller. It kind of looks like the name table is
broken or similar.

Note that the undefined error on quit occurs when running GS interactively
and even when this happens, "systemdict /quit get exec" works, so its not
as simple as /quit being undefined.

No differences expected.

gs/Resource/Init/gs_init.ps
gs/psi/imain.c


2014-08-13 20:33:36 +0100
Chris Liddell <chris.liddell@artifex.com>
062f4b4536b7b3fa1742e31c05dc57fe241d6690

Bug 695423: follow up.

Fix the description comments.

No cluster differences

gs/devices/devs.mak


2014-08-13 19:28:04 +0100
Gerard Belanger <gbelanger@practicalautomation.com>
25a0cd96ac4b44d96e27c435dad5cc2c31788733

Bug 695423: Add current generation printers to gdevatx.c

Practical Automation printers.

No cluster differences.

gs/configure.ac
gs/devices/devs.mak
gs/devices/gdevatx.c


2014-08-12 10:17:01 +0100
Ken Sharp <ken.sharp@artifex.com>
9a80562145b25a7166bd7c8e005446bd306be34e

ps2write - fix conversion of TrueType fonts with format 0 LOCA tables

Bug #695417 "gs(ps2write) produce invalid ps from certain LibreOffice print emission"

The code in the opdfread prolog for converting TrueType fonts to type 42
fonts was completely broken for fonts with a format 0 LOCA table (16 bit
offsets). The offending routine is StringToLoca.

The code was reading 32 bits instead of 16, which causes it to exhaust
the string data, leaving array members uninitialised, which is the inital
cause of the error. However, it also didn't multiply the offsets it did
read by 2 (format 0 LOCA offsets are multiplied by 2), and had a 'dup'
which resulted in the stack having the wrong value on top on exit.

No differences expected

gs/devices/vector/opdfread.h
gs/lib/opdfread.ps


2014-08-11 21:22:46 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4fc4b8410d35b193d549558ab212cc727db9460b

Bug 694160: Prevent malicious code being injected into the system.

gs/Resource/Init/gs_init.ps
gs/psi/imain.c


2014-08-08 11:55:55 +0100
Ken Sharp <ken.sharp@artifex.com>
5be9d0429b79f53b0e074fb1042cf3e88134ba0d

remove an unused variable to silence a compiler warning

gs/devices/gdevtsep.c


2014-08-08 10:07:24 +0100
Ken Sharp <ken.sharp@artifex.com>
3a035a2a9e94196920f99a18670ee96202f67bb9

tiffsep - add code to print CMYK equivalents for spot inks

Bug #695407 "tiffsep should print out separation equivalent CMYK"

Patch supplied by Mateusz Lenik to print out the CMYK equivalents for every
ink in the job.

Controlled by the new PrintSpotCMYK switch, which is only supported on the
tiffsep device, documented in devices.htm.

No differences expected.

gs/devices/gdevtsep.c
gs/doc/Devices.htm


2014-08-05 13:25:01 +0100
Chris Liddell <chris.liddell@artifex.com>
5671fc9b4b5fc8abb326e60195dff7ec46d5b389

Bug 695394: fix TTF glyph encoding generation

There was a logical error in the glyph encoding generation for TT fonts,
affecting fonts without post tables.

When handling the case where the same glyph name references two different
glyphs, the index in the glyph encoding we wrote the generated name to was the
GID (i.e. the index returned from the cmap table) rather the original index
we were handling from the glyph encoding.

No cluster differences.

gs/Resource/Init/gs_ttf.ps


2014-08-01 14:50:40 +0100
Ken Sharp <ken.sharp@artifex.com>
275dc99017b96c1be74a50026479dbdf8d63192f

PDF interpreter - fix Hybrid file parsing

Bug #695403 "Error ocurred while reading XREF table"

The fix for bug #694342 treated an xref section with no entries as an error
and caused the xref to be rebuilt. However, if a PDF file is converted into
a hybrid file (one with an xref *and* an XrefStrm) by adobe CS 3, then it
does this by adding a 'dummy' xref which has a /Prev pointing to the real
xref, and a /XrefStrm pointing to the stream.

The dummy xref has a section "0 0", is first object 0, no objects defined
which falls foul of the test for Bug 694342 and causes the xref to be rebuilt.

This commit adds a boolean which is initially false and is set true in the
parsing loop for the xref section. When we encounter a /trailer, instead
of checking if 0 objects are defined, we now look at that boolean. If its
'true' then we have seen a section entry, and can treat this as valid, even
if no objects are yet defined. If we haven't seen a section then we treat
it as invalid and force an xref rebuild.

This causes sumatra/694313_-_empty_xref.pdf to stop producing errors as
well.

gs/Resource/Init/pdf_main.ps


2014-08-01 09:52:00 +0100
Ken Sharp <ken.sharp@artifex.com>
80395ccbe7558e324ff3cb75c3e241ce0ffd735d

ps2write - fix a bug in the debug code

The PrintHex routine assumes that PostScript integers are 32 bits wide.
This is no longer guaranteed with GS. This fix ensures that after we do
the bit shifting to isolate 4 bits for conversion to hex, we don't have
a number > 15, which could occur if the integer was sufficiently large.

This prevents the code throwing an error when debugging.

No differences expected

gs/devices/vector/opdfread.h
gs/lib/opdfread.ps


2014-07-30 15:33:00 +0100
Chris Liddell <chris.liddell@artifex.com>
9fbecef99a40d8a5b372fadf4ed99fe29c6815a9

Bug 695397: handle "unknown" glyph names >16 chars long

When creating glyph aliases for a TTF, we check for "formatted" unicode glyph
names of the form "uniWXYZ" where "WXYZ" is the glyph code point in base 16.

In doing that we use a temporary string which is 16 characters long (since the
formatted names we're interested won't be longer that 16).

So, check the glyph name is <16 chars long before checking if it's a "uni..."
style name.

No cluster differences.

gs/Resource/Init/gs_ttf.ps


2014-07-30 08:34:29 +0100
Chris Liddell <chris.liddell@artifex.com>
7a2d86136669e79742aacda148e5c70854273ca5

Bug 695380: add a simple sanity check in i_alloc_string

Checks for integer overflow.

No cluster differences.

gs/base/gsalloc.c


2014-07-29 17:26:27 +0100
Chris Liddell <chris.liddell@artifex.com>
f25cb59f2ed56df8366d03c5cb7d9b37dec77934

Bug 695319: Set pdf14 (trans) ctx to NULL on free on error

In the event of an interpreter triggered error during a transparency operation,
pdf14_discard_trans_layer() is called to clean up. It frees the context, but
didn't set the ctx pointer to NULL - thus we could try to free the already
freed context object when the pdf14 compositor device is shut down.

No cluster differences.

gs/base/gdevp14.c


2014-07-29 15:37:45 +0100
Chris Liddell <chris.liddell@artifex.com>
e889a18896e668e5e565e5ec1cada8b8a64c60a2

Bug 695318: mark memory chunks used for single allocations.

Certain chunks in the memory manager are used to contain only one (o_alone)
allocation: "large" allocations and "immovable" allocations specifically.

We need to be able to identify those chunks so we don't end up trying to use
any empty space in them for later allocations - these chhunks can end up with
empty space in them if the original object allocated in them is shrunk.

The problem that occurs is when we free an o_alone object, we immediately free
the chunk containing it, thus any other allocations in that chunk are also
freed.

Adding a c_alone flag to the chunk means we can trivially identify and skip
those chunks when searching for free memory.

No cluster differences.

gs/base/gsalloc.c
gs/base/gxalloc.h


2014-07-25 15:57:30 +0100
Chris Liddell <chris.liddell@artifex.com>
21d86e8264a6cd11f963b4c36b989ab4c0ed3294

Bug 695363: handle TTF with no/empty loca table.

A broken TT font could end up with us allocating a zero length array for
the for the glyph lengths, then later to attempt to access entries in that
array.

Thus, avoid allocating the zero length array, and treat a NULL glyph_len array
the same as a glyph_len of 0.

No cluster differences.

gs/base/gstype42.c


2014-07-24 14:26:30 -0700
Ray Johnston <ray.johnston@artifex.com>
ea4547f4bc24803f167e8a0b1a1384d9dc8af9e8

Add setting buf->backdrop to NULL when knockout is false.

Minor issue, but I did find a case where the buf->backdrop was left
uninitialized when working on customer 532 issue with fts_25_2526.pdf

gs/base/gdevp14.c


2014-06-02 21:17:54 +0200
Tor Andersson <tor.andersson@artifex.com>
23f71dd93eeac60f0ff3c58b17bcd8ccd2d971d6

xps: Remove trailing whitespace.

xps/xpsgradient.c
xps/xpsimage.c
xps/xpsjxr.c
xps/xpsopacity.c
xps/xpspath.c
xps/xpspng.c
xps/xpstiff.c


2014-06-02 21:06:47 +0200
Tor Andersson <tor.andersson@artifex.com>
eed68003a30b64649157b7dcdcfc1d5162c3bb63

xps: Allow colormapped 1-bit TIFF files.

Thanks to Norbert Janssen.

xps/xpstiff.c


2014-06-02 21:01:18 +0200
Tor Andersson <tor.andersson@artifex.com>
3b03ee5480ab38f0d7b4e2ad341385d7dffd8343

xps: Improve transparency analysis for resource dictionaries.

Thanks to Norbert Janssen.

xps/xpsanalyze.c


2014-07-22 09:09:47 +0100
Ken Sharp <ken.sharp@artifex.com>
8d3081c0403a1d911a79dce57008ede4279d050a

pdfwrite and ps2write - Mimic the -dNOCACHE output of pswrite

This feature is in response to the thread on gs-devel "pswrite and NOPLATFONTS"

Normally pdfwrite and ps2write try very hard to maintain fonts from the input
as fonts in the output, for reasons of output size, performance and qualiity.

It seems that some people are relying on using pswrite with -dNOCACHE in
order to produce PostScript output with no fonts at all. (As far as I can
see this is to address the limitations of other software). This was never
a goal for pswrite, but it seems that it works 'well enough' to be useful.

Sadly, despite us flagging the fact that pswrite had been deprecated, nobody
gave us any feedback until after (several releases after, in fact) we had
removed the device. We are not going to reinstate support for the pswrite
device, having spent effort to remove it in order to drop support for it,
so this commit adds a new feature which causes pdfwrite and friends to
write the glyph description into the content stream as it is used instead
of constructing fonts.

This is controlled with the new switch NoOutputFonts which defaults to false

There are no cluster differences with this commit. Using the switch causes
pretty much every test file which contains text to render differently.

gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfp.c
gs/devices/vector/gdevpdfx.h
gs/devices/vector/gdevpdtt.c
gs/doc/Ps2pdf.htm


2014-07-21 11:02:55 +0100
Chris Liddell <chris.liddell@artifex.com>
b6575b8a91e23365b340771fc67b29819ba7937b

Have pdfwrite/ps2write "flatten" glyphs...

...into "normal" marking ops if the glyph cache is disabled.

gs/devices/vector/gdevpdtt.c


2014-07-11 13:52:31 +0100
Chris Liddell <chris.liddell@artifex.com>
f35a388327055a3a2635c91f5e1080af6d957d37

Bug 694205: prevent crash rendering unfeasibly large glyph

Initialise the "prev" entry in the top node in the x line list to null and
check it isn't null before we use it. If we reach that point, it indicates that
a) the current path reaches (and probably passes) the limits of our coordinate
space and b) the line list is already in the correct order - as best it can be,
anyway.

No cluster differences.

gs/base/gxfill.c


2014-07-16 13:14:42 -0600
Henry Stiles <henry.stiles@artifex.com>
56162c7c6c55bd2f98e4a25fa399c0a5865f7249

Bug #695367 - Writing a 64 bit integer into a 32 bit format specifier
corrupted sprintf's variadic argument list on some (windows)
platforms.

gs/devices/vector/gdevxps.c


2014-07-14 16:05:36 -0600
Henry Stiles <henry.stiles@artifex.com>
ef4150919c5dc6c0fcf441cc499a3250d8a6529e

Use a conditional form feed when selecting a page side, #695325.

pcl/pcjob.c


2014-06-27 06:59:09 -0600
Henry Stiles <henry.stiles@artifex.com>
a6fc36d436fa166c87d4d75d3f7d037f80cf6ce6

Bring comment in line with recent changes to the printable region.

pcl/pcxfmst.h


2014-07-07 12:31:13 +0100
Ken Sharp <ken.sharp@artifex.com>
4823edf7be9b8dd1e40306e1b5e0f0edbecb84be

pdfwrite - prevent closing the device if its not open

Bug #694380 "Seg fault in pdfwrite"

The file in question throws an error in pdfwrite when we try to write a
FontDescriptor (the font is broken). The PDF interpreter, however,
often ignores errors and continues trying to process the input file.

When producing one output file this is not a problem, as the error occurs
in pdf_close() and so it all works. However, when producing one file per
page this fails, because we close the device, notice the error, and
do not open it anew. However the PDF interpreter just carries on. When we
come to the end of the next page we try to close a device which is already
closed, and this means we try to dereference an invalid pointer.

In this commit we check the 'is_open' flag of the device in pdf_close and
if the device is not open then we jump straight back out. We also set is_open
to false in the same routine as it wasn't previously being set (because we
couldn't previously close and reopen the device).

This fixes the problem with Bug693711.pdf for me.

gs/devices/vector/gdevpdf.c


2014-07-07 09:00:20 +0100
Ken Sharp <ken.sharp@artifex.com>
84bdbfec67808ea22ec152a56bcb33655ef084aa

pdfwrite - add an include file for a prototype, silences a compiler warning

gs/devices/vector/gdevpdfk.c


2014-07-04 12:02:59 +0100
Ken Sharp <ken.sharp@artifex.com>
ddae2b83fd7e91053d62b2d4533e850fdba341bf

pdfwrite - fix memory corruption caused by type 3 capture of PCL fonts

Bug #695350 "GhostPCL line shifting"

It was impossible to reproduce this bug exactly as the reporter is running
Ghostscript on an unusual platform. Fortunately what appears to be the same
problem could be reproduced on a PowerPC Mac running Linux. It is possible
that this commit doesn't actually fix the bug though.

When capturing glyph descriptions in order to build a type 3 font from a
PCL font, we were saving the default text procedures from the enumerator
(which was created by gx_default_text_begin), and then restoring them when
we had finished processing the glyph. However, by that time we had already
releases the enumerator, which meant we were corrupting memory.

Desk checking the code, I can't see any reason for saving the procedures
from the text enumerator, and I conclude this is either a holdover from an
earlier version of this code, or an oversight when writing the code that
captured PCL fonts. In any event this commit removes the save/restore
behaviour, since it is definitely causing memory corruption.

No differences expected.

gs/devices/vector/gdevpdtt.c


2014-07-02 13:42:07 +0100
Ken Sharp <ken.sharp@artifex.com>
3bfacc81f717f6e658f3cb4575ded0c36919ec4e

pdfwrite - detect corrupted type 3 fonts and generate an errror

Bug #694186 "Seg faults found by fuzzing in names_index_ref"

The file has a corrupted glyph in a type 3 font, which throws an error.
However, pdfwrite can't tell that the glyph threw an error rather than
simply completing successfully, and tries to use the returned glyph ID. The
glyph ID is GS_NO_GLYPH which fails with a seg fault when looking up the
name.

In this commit we check the glyph ID to see if its GS_NO_GLYPH and throw an
error if it is. This prevents us looking up an invalid glyph ID in the
name table, and the file is demonstrably broken.

This fixes a1c8db... the other file, cc5c... is also fixed, but in newer
code never even makes it to this point as the current code detects a different
problem before it reaches this point.

gs/devices/vector/gdevpdtt.c


2014-07-01 17:30:17 +0100
Ken Sharp <ken.sharp@artifex.com>
4d2e447a5226bf8b1baf6f079f3e767c72928d88

pdfwrite - ensure we have V2 ICC profiles for PDF/A-1 and PDF < 1.5

Bug 695118 "PDF/A-file is generated with ICC version 4.2 profiles"

PDF/A-1 requires us to use ICC v2 profiles due to the level of PDF mandated
by the spec. In addition, we should not use V4 profiles when producing
PDF less than 1.5.

Michael added considerable code to allow us to get a V2 profile, given a
V4 profile, and this commit makes the changes required for pdfwrite. Its more
extensive than appears necessary because we need access to the current
imager state in order to generate the V2 profile, so a large number
of routines have been altered to pass along the imager state (or NULL in
some cases, where we can only be dealing with device spaces anyway).

We also change the default version of PDF we produce to 1.5 so that we can
emit V4 profiles and alter the 'prepress' predfined settings similarly.

This causes changes in a Genoa CET file, but its just different, not wrong.

gs/Resource/Init/gs_pdfwr.ps
gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.c
gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfc.h
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfg.h
gs/devices/vector/gdevpdfi.c
gs/devices/vector/gdevpdfk.c
gs/devices/vector/gdevpdft.c
gs/devices/vector/gdevpdfv.c


2014-07-01 09:41:38 +0100
Ken Sharp <ken.sharp@artifex.com>
c4dfed923d2513e4b79f8c765b5682e628b2fa60

pdfwrite - colour conversion

When converting a Separation alternate space we create a new space which
uses the ink name pf the Separation. We were putting the name into the
space without copying it, which can lead to it being freed while the original
space is still pointing to it.

Follow on from commit e492e1671b7b1041ba123a22c1df3b920cf753af which
addressed DeviceN spaces.

No differences expected.

gs/devices/vector/gdevpdfg.c


2014-06-30 10:14:08 +0100
Ken Sharp <ken.sharp@artifex.com>
c88ded04ea9977d994b243720b8fa32bc7fa56e7

Type 42 font - correctly initialise Max Composite points and Contours

The previous commit which initiaslised these (by me) was incorrect, the
values are 2 byte shorts, not 4 byte ints.

No differences expected.

gs/base/gstype42.c


2014-06-30 09:40:26 +0100
Ken Sharp <ken.sharp@artifex.com>
e492e1671b7b1041ba123a22c1df3b920cf753af

pdfwrite - colour conversion of DeviceN alternate spaces

Bug #695306 "Converting a PDF to RGB colorspace causes missing drawing parts"

There are two problems addressed in this commit.

Firstly the code wasn't catering properly for the possibility of an /Indexed
DeviceN space. We did dereference the Indeexed space, but not until after
we had tried to use the original space as a DeviceN, with unfortunate
potential results. We move the dereference to the top of the function
convert_DeviceN_alternate so that we properly use the DeviceN space.

Secondly when creating the new colour space (ie with a different alternate
space), we add the names of the inks from the original DeviceN space.
However, we were using add_no_copy which meant when the new array was
garbage collected we freed the names, but left them being pointed at by
the original array, leading to pointers to garbage memory.

No differences expected as the colour conversion is not tested by the cluster

gs/devices/vector/gdevpdfg.c


2014-06-27 04:58:24 -0700
Ray Johnston <ray.johnston@artifex.com>
9f7902c6a9a5a2315901b3d5ef32e98feefe7e86

Fix compiler warnings and dependencies.

gs/base/gspaint.c
gs/base/gxclthrd.c
gs/base/lib.mak


2014-06-26 18:12:52 -0700
Michael Vrhel <michael.vrhel@artifex.com>
abcf61e770b8b4687c571f321c79e6a0bb0a7424

Fix compiler warnings in ICC generation code.

gs/base/gsicc_create.c


2014-06-26 16:26:44 -0600
Henry Stiles <henry.stiles@artifex.com>
417ffa428a427abd327ab7be48759d536b0689a6

PCL no longer needs to maintain the hardware clipping state with the
change to have the device maintain the printable region (HWMargins).
See last commit.

pcl/pcpage.c
pcl/pcxfmst.h
pcl/pgdraw.c


2014-06-26 18:22:22 +0100
Chris Liddell <chris.liddell@artifex.com>
5470aa39ebcfff65fb00e163f781c5769f4f9c18

Bug 695334: fix seg fault with CIDFont substitution.

When deciding whether to share the subst_CID_on_WMode table between CIDFont
objects, make sure the two fonts are allocated in the same VM mode. If they
differ, do not share the table.

No cluster differences.

gs/psi/zfcid1.c


2014-06-26 18:21:07 +0100
Chris Liddell <chris.liddell@artifex.com>
c73b4d533dc236427d57b3e8f9725f12d8d0aadd

Add the SubstCID resources to the romfs.

No cluster differences

gs/psi/psromfs.mak


2014-06-24 05:46:32 -0700
Ray Johnston <ray.johnston@artifex.com>
02c486ce654faf99eac1dcd262651af5d32bae05

Add pageneutralcolor as a printer device parameter to allow query.

fillpage (erasepage from PS) will re-enable monitoring so we needn't
ouptut the page in order to restart monitoring.

This allows PostScript or clients to use get_params or get_param to
read the pageneutralcolor state. Presumably this would be used prior
to showpage. Coupled with the EndPage proc, PS can examine this even
without emitting the pages.

Note that this is only accurate when in clist mode, so -dMaxBitmap=0
and -dGrayDetection=true should both be used.

gs/base/gdevprn.c
gs/base/gspaint.c
gs/doc/Language.htm


2014-06-26 07:59:12 -0600
Henry Stiles <henry.stiles@artifex.com>
f3f29cf2f2ad9ab30c0a10f0634ec4d2d06d906c

Default PCL to full bleed, setting the printable region margins to 0.

Actually this change was partially implemented previously, but there
were still lingering parts of the code that used the 1/6" border to
affect the output. Older HP printers default to a 1/6" inch printable
region. This can be implemented by changing the default HWMargins in
the device or by setting them with the command line option -H, see the
PCL documentation for details.

pcl/pcpage.c


2014-06-25 20:23:17 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b13d19749b58b2b0263013ad9a516c36e56cdb1c

Fix wrong pointer type passing to gsicc_create_compute_cam

No differences expected since the pointer type mix up happened to
be both float types

gs/base/gsicc_create.c


2014-06-25 14:59:54 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d6be178195f97d7fa1cd2ae010e5d9e89f911e1a

Apply cat02 chromatic adaptation to primaries when creating ICC profile from CalRGB

While I had pickled the CAM into the transform created using the lutAtoB type, I
failed to apply the transform for the matrix based solution that is used for the
profile when created from CalRGB. I did have a comment in the code that this needed
to be done.

Several progressions occur.

gs/base/gsicc_create.c


2014-06-25 08:54:43 -0600
Henry Stiles <henry.stiles@artifex.com>
759230353994354ae7417cdab1bbb09924dea70f

Add an option to set hardware margins.

There was no way to specify Ghostscript .HWMargins on the command line
because the PCL option parser cannot parse most composite objects. So
we add a '-H' option to be followed by 4 numbers: left, bottom, right
and top margin.

doc/ghostpdl.pdf
doc/ghostpdl.tex
doc/ghostpdl.txt
pl/plmain.c


2014-06-24 12:33:48 +0100
Chris Liddell <chris.liddell@artifex.com>
f293a2fd1bfed25a69d64472967417d7d40d08ff

Fix memory leak in libjpeg custom memory management

Noticed working on another issue: the cleanup function was missing for the
custom libjpeg memory management code.

No cluster differences.

gs/base/sjpeg.h
gs/base/sjpegc.c


2014-06-19 17:23:26 +0100
Chris Liddell <chris.liddell@artifex.com>
0fc3bea788f6b65062432ff4bc6eace3cc713e63

Various ICC profile related memory leak fixes

Raised by cust 532.

Add several "finalize" methods so ICC profiles (not in garbage collected memory)
get freed or ref count decremented appropriately when the referencing object
*is* garbage collected.

Also, there were some mismatched ref count increments.

No cluster differences.

gs/base/gdevp14.c
gs/base/gscms.h
gs/base/gsicc_cache.c
gs/base/gsicc_lcms.c
gs/base/gsicc_lcms2.c
gs/base/gsicc_manage.c
gs/base/gsicc_nocm.c
gs/base/gsstate.c
gs/base/gstrans.c
gs/base/gxclist.c
gs/base/gxclist.h


2014-06-24 13:26:58 +0100
Ken Sharp <ken.sharp@artifex.com>
d936f19a3342a8da88b32a1559087b3a38c66832

pdfwrite - more changes to better handle sRGB ColorConversionStrategy

Following on from commit d704ab3d30b6119c8169d8827226f7325e5ee87f an
additional 3 cases where I believe we need to handle sRGB as per RGB.

These changes are committed separately as they were found by code inspection
and I don't have a test case for them.

No differences expected

gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfi.c


2014-06-24 12:51:16 +0100
Ken Sharp <ken.sharp@artifex.com>
d704ab3d30b6119c8169d8827226f7325e5ee87f

pdfwrite colour conversion - handle alternate conversion to sRGB from DeviceN

Bug #695316 "A DeviceN image in pdf can't be converted to RGB image, it is converted to many paths instead"
Bug #695306 "Converting a PDF to RGB colorspace causes missing drawing parts"

The code for converting a DeviceN alternate space and tint transform wasn't
catering for a ColorConversionStrategy of /sRGB. This commit ads the
ccs_sRGB case, and converts it to RGB as per the documentation, using the
selected RGB profile.

Bug 695316 now converts the image to an image, though it produces an error
on exit relating to ICC profiles.

Bug 695306, for me, caused a seg fault, which this commit corrects. I do not
see any missing content with either sRGB or RGB conversion. I do see the
same error as for Bug #695316 and I'll continue working on that problem
under that bug number

No differences expected, the c;luster doesn't test colour conversion

gs/devices/vector/gdevpdfg.c


2014-06-21 09:22:10 +0100
Ken Sharp <ken.sharp@artifex.com>
699e5a8478c2acbe34add1a9b2bd809779001e3f

pdfwrite - preserve enumerator text for composite data

Bug #695322 "Distilling PS to PDF using GS causes strange characters for spaces when using a particular sequence in the PS"

The problem occurs because when processing text in a composite font pdfwrite
overwrites the string data while working on it. In general this is not actually
a problem, as the string data argument to the show family of operators is
normally not reused.

However, in this case the customer's PostScript inserts space glyphs by calling
a bound procedure, instead of simply calling show. The first execution works
properly, but corrupts the string, the second execution uses the corrupted
string as the data, and is unable to find a glyph in the font to match the
corrupted data, which results in the /.notdef being used instead.

The particular routine in question (scan_cmap_text) is one of the most
convoluted and bloated routines in pdfwrite, and after some inspection it
was obviously going to be very difficult to avoid overwriting the string
data, it would run considerable risk of breaking the code in subtle ways,
and would in any event mean copying the string data around, possibly mutliple
times.

Accordingly I've chose to make a new copy of the string data in
process_cmap_text, which is the only parent of scan_cmap_text, and save/restore
the string data round the call. This prevents the bound string being
corrupted and fixes the problem.

This also exhibits a progression in Bug691680.ps and I've noted in that
thread that the remaining problem is fixed.

gs/devices/vector/gdevpdtc.c


2014-06-20 17:53:49 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2322d38f28a21cfaad42e66398bcc34077818beb

Addition of code in gsicc_create.c to create V2 ICC profiles from V4 ICC profiles

This is needed to support a version of PDF-X that requires V2 ICC profiles.

gs/base/gscms.h
gs/base/gsicc_cms.h
gs/base/gsicc_create.c
gs/base/gsicc_create.h
gs/base/gsicc_lcms2.c
gs/base/gsicc_manage.c
gs/base/gsicc_manage.h


2014-06-19 13:43:37 +0100
Ken Sharp <ken.sharp@artifex.com>
d6a29d5618f95cbbd299a5d5d02ec820ae8d7ced

Check for trivially clipped out images before checking trivially non-clipped

Bug #695320 "Difference in bbox result from 9.06 onwards"

commit a13600f1c241c3e36dbe4973e9d78a8934b16004 introduced checks to see
if we actually needed a clip device before going ahead and installing it.
However, the order of checks was slightly incorrect. The code clamps the
rectangle to be tested to the outer box of the clip path, then checked to
see if the rectangle was completely included in the inner box.

If the object was completely clipped out then the rectangle would be clamped
to the outer box of the clip. If the outer and inner boxes were the same
(rectangular clip) then the test could decide that the totally clipped out
rectangle was in fact completely enclosed in the inner box.

We fix this here by checking to see if the image is clipped out (by testing
to see if the top/bottom or left/right edges are co-incident) before we
check for trivial inclusion.

For totally clipped out objects we then abort the object which, like the
original fix prevents us installing a clip device and also prevents us
going through the trapezoid degeneration., Potentially a small performance
win, as well as getting the bbox correct.

No differences expected

gs/base/gxclip.c


2014-06-16 07:06:09 -0700
Ray Johnston <ray.johnston@artifex.com>
8269dd2b5f6d5aea4a5c1a6374dd7f6e6b7202f5

Fix parameters to tile_by_steps that improves performance on J10

Found while investigating performance for cust 532, one of the calls
to tile_by_steps in gx_trans_pattern_fill_rect passed the rect upper
right rather than the width and height. This improved the time spent
in tile_by_steps from 8 sec to 4 sec on the JEITA J10 page.

gs/base/gxp1fill.c


2014-05-30 07:40:56 -0700
Ray Johnston <ray.johnston@artifex.com>
9b6c504d49663d737dffbd42aace7891c3fb15dd

Fix Knockout true, Isolated false blending with pdf transparency. fts_25_2524

This was reported by customer 532. Knockout blending was seriously broken in
not using the background correctly when not isolated, and knockout blending
in art_pdf_composite_knockout_simple_8 did not handle blend modes other than
normal. Also pdf14_compose_group was basing decisions on tos_isolated when
nos_isolated was needed, and a special check for tos_knockout when the nos
is the page level was not needed.

gs/base/gdevp14.c
gs/base/gxblend.c
gs/base/gxblend.h
gs/base/gxblend1.c


2014-06-12 15:44:47 +0100
Ken Sharp <ken.sharp@artifex.com>
77f9aa46adf05063752c9afdcd6cff92b332cb66

txtwrite - fix a couple of compiler warnings

gs/devices/vector/gdevpdfm.c


2014-05-27 14:50:25 +0100
Chris Liddell <chris.liddell@artifex.com>
b8a9352dac5e388de3c596371143040722fa2285

Bug 695258: optimize AGL name mapping.

Add a "reverse AGL" dictionary which allows us to create the extra name mappings
with one pass over the CharStrings dictionary, rather than two passes over the
entire AGL dictionary.

No cluster differences.

gs/Resource/Init/gs_agl.ps
gs/Resource/Init/gs_ttf.ps
gs/Resource/Init/gs_type1.ps
gs/psi/int.mak


2014-06-12 08:46:53 +0100
Ken Sharp <ken.sharp@artifex.com>
1413e11d39ea015f1568a7ed7f00f99e16534259

pdfwrite - more improvements on GoToR and link processing

Still Bug #695269

This time we take account of possible FirstPage and LastPage settings and
*don't* apply them to GoToR actions.

No differences expected.

gs/devices/vector/gdevpdfm.c


2014-06-11 13:38:56 -0600
Henry Stiles <henry.stiles@artifex.com>
759c5f4aca61fe8914eaec8d86e0a64850034430

Deterministic seeding for random number generator so the file can be
regression tested.

gs/examples/snowflak.ps


2014-06-10 17:39:23 +0100
Chris Liddell <chris.liddell@artifex.com>
e4a278eccdfd1f7b45daee3b77f9776fcd11e686

Up the required version of autoconf to 2.60

Due to our (long term!) use of the AC_PROG_SED macro, we need autoconf
2.60 (the macro was actually added to the 2.59b release, but 2.60 is close
enough).

No cluster differences

gs/configure.ac


2014-06-10 15:28:28 +0100
Ken Sharp <ken.sharp@artifex.com>
cb32f7a923fbe661d5b959e8c7a24c147de7f782

pdfwrite - don't include 'GoToR' references in check of destinations

Bug #695269 " PDF file containing outline or link annotation with GoToR action processing ended with a message "ERROR: A pdfmark destination page XXX points beyond the last page YYYY.""

The problem is that the function which gets a numeric page number, either by
finding the /Next or /Prev keys or by finding an absolute page number, was
also updating the 'max_referred_page' variable. This is checked when closing
the PDF file and an error message emitted if it exceeds the number of pages
in the PDF file.

Of course, for a GoToR action, its valid for the destination (which is in a
different file after all) to be greater than the number of pages in the current
file.

This commit removes the update for the max_referred_page variable from
pdfmark_page_number, and places it in the calling function. This makes more
sense to me, its not reasonable that s utility function should have an
unexpected side effect like that, and it makes more sense for the function
which handles the destination to decide whether it should update this variable.

No differences expected, we don't test this on the cluster.

gs/devices/vector/gdevpdfm.c


2014-06-10 13:31:07 +0100
Ken Sharp <ken.sharp@artifex.com>
baecaed381a6799e71c451933c3a1707f5653782

pdfwrite - improved handling of images with > 8 BPC

Bug #691713 "/rangecheck in fts_18_1805.pdf on pdfwrite device"
Bug #694731 "pdfwrite doesn't handle 16 bpc images"

To date images with more than 8 bits per component, using any transparency
features, resulted in a rangecheck error as the code was incapable of
handling 12 or 16 bpc.

The new image code (improved for colour management) now allows us to apply
a simple 16->8 (discarding the lower 8 bits) subsampler and this results
in all the files which caused problems working correctly.

In addition, many files which previously 'fell back' to the default implementation
(where each image sample is transformed into a filled rectangle) now preserve
the image as an image. This makes the resulting PDF or PostScript file
considerably smaller and quicker to process.

Note that this *only* works if the ColorConversionStrategy is 'LeaveColorUnchanged'
This is because the existing image colour space conversion code cannot cope
with anything other than 8-bit input.

A number of test files show differences.

The majority are PDF files which previously had content missing but now
render correctly.

A number are due to the fact that the image is no longer degenerated into
thousands of rectangles which means that it is recompressed, if the input
was JPEG and the compression is also JPEG this results in visible artefacts.

Some files show differences due to the fact that the naive downsampling
gives slightly different results from the accurate colour conversion. These
show slight improvements in about as many cases as they show slight degradation

gs/devices/vector/gdevpdfi.c


2014-06-09 08:23:09 +0100
Ken Sharp <ken.sharp@artifex.com>
5cc8aa8af871ab95ddebc2fc15baaf261bd8bb89

PDF interpreter - remove some commented out code

Commit 33fb85045c2590ac58a723ea2abcfbde505e53d1 included some code which was
commented out but should have been removed.

gs/Resource/Init/pdf_draw.ps


2014-06-07 11:46:00 +0100
Ken Sharp <ken.sharp@artifex.com>
33fb85045c2590ac58a723ea2abcfbde505e53d1

PDF interpreter - improve synthesis of text form fields with no /AP

Bug #694738 " Text synthesis of missing appearances in the PDF interpreter does not handle UTF16BE"

Previously we didn't strip the 0xFE 0xFF byte order mark from UTF16-BE strings
this commit removes them. We also remove the requirement for a /DA (Default
Appearance) to be present in a Text field before we synthesise a replacement
for a missing AP, taking int account any UTF16 strings.

This does not 'fix' bug #694738 but this is because the /DA uses a font which
is not correctly encoded to draw UTF16 text. The font uses an /Identity-H
CMap which is unlikely to work with UTF16. Replacing it with our own fallback
CID font and using a /Identity-UTF16-H CMap draws the text correctly, which
shows that the problem is the font. NB Acrobat (as usual) ignores appearances
and creates its own representation, so the Acrobat display is not an indication
of a bug in GS.

A few files in the test suite show differences because we no longer attempt
to print the BOM.

gs/Resource/Init/pdf_draw.ps
gs/Resource/Init/pdf_ops.ps


2014-06-06 17:06:32 +0100
Chris Liddell <chris.liddell@artifex.com>
b5e0be23db6988057a0007cec24b592180ec25ff

Handle the Identity-UTF16-H CMap "properly"

For "normal" identity CMaps we skip a step in decoding the CID to the GID, but
this should not be done for the Identity-UTF16-H CMap.

Relates to (but does not resolve) Bug 694738.

No cluster differences.

gs/psi/zfapi.c


2014-06-05 16:37:36 +0100
Chris Liddell <chris.liddell@artifex.com>
235b2db4ab9cfd5b82bb45fb941bec04d41a00c8

Tweaks for cups 1.7.3 to build on Windows and OS X

No cluster differences

gs/cups/libs/cups/cups.h
gs/cups/libs/cups/debug.c
gs/cups/libs/cups/globals.c
gs/cups/libs/cups/ipp.c
gs/cups/libs/cups/language.c
gs/cups/libs/cups/usersys.c
gs/psi/msvc.mak


2014-06-05 15:36:03 +0100
Chris Liddell <chris.liddell@artifex.com>
e9b8fbfed2c406ef7612f8c7b7e846f71a2d93d1

Update libcups to 1.7.3

gs/base/lcups.mak
gs/base/lcupsi.mak
gs/cups/libs/configlinux.h
gs/cups/libs/configwin.h
gs/cups/libs/cups/Dependencies
gs/cups/libs/cups/Makefile
gs/cups/libs/cups/adminutil.c
gs/cups/libs/cups/adminutil.h
gs/cups/libs/cups/api-array.header
gs/cups/libs/cups/api-array.shtml
gs/cups/libs/cups/api-cups.header
gs/cups/libs/cups/api-cups.shtml
gs/cups/libs/cups/api-filedir.header
gs/cups/libs/cups/api-filedir.shtml
gs/cups/libs/cups/api-filter.header
gs/cups/libs/cups/api-filter.shtml
gs/cups/libs/cups/api-httpipp.header
gs/cups/libs/cups/api-httpipp.shtml
gs/cups/libs/cups/api-overview.header
gs/cups/libs/cups/api-overview.shtml
gs/cups/libs/cups/api-ppd.header
gs/cups/libs/cups/api-ppd.shtml
gs/cups/libs/cups/array-private.h
gs/cups/libs/cups/array.c
gs/cups/libs/cups/array.h
gs/cups/libs/cups/attr.c
gs/cups/libs/cups/auth.c
gs/cups/libs/cups/backchannel.c
gs/cups/libs/cups/backend.c
gs/cups/libs/cups/backend.h
gs/cups/libs/cups/conflicts.c
gs/cups/libs/cups/cups-private.h
gs/cups/libs/cups/cups.h
gs/cups/libs/cups/custom.c
gs/cups/libs/cups/debug-private.h
gs/cups/libs/cups/debug.c
gs/cups/libs/cups/debug.h
gs/cups/libs/cups/dest-job.c
gs/cups/libs/cups/dest-localization.c
gs/cups/libs/cups/dest-options.c
gs/cups/libs/cups/dest.c
gs/cups/libs/cups/dir.c
gs/cups/libs/cups/dir.h
gs/cups/libs/cups/emit.c
gs/cups/libs/cups/encode.c
gs/cups/libs/cups/file-private.h
gs/cups/libs/cups/file.c
gs/cups/libs/cups/file.h
gs/cups/libs/cups/getdevices.c
gs/cups/libs/cups/getifaddrs.c
gs/cups/libs/cups/getputfile.c
gs/cups/libs/cups/globals.c
gs/cups/libs/cups/globals.h
gs/cups/libs/cups/http-addr.c
gs/cups/libs/cups/http-addrlist.c
gs/cups/libs/cups/http-private.h
gs/cups/libs/cups/http-support.c
gs/cups/libs/cups/http.c
gs/cups/libs/cups/http.h
gs/cups/libs/cups/i18n.h
gs/cups/libs/cups/ipp-private.h
gs/cups/libs/cups/ipp-support.c
gs/cups/libs/cups/ipp.c
gs/cups/libs/cups/ipp.h
gs/cups/libs/cups/langprintf.c
gs/cups/libs/cups/language-private.h
gs/cups/libs/cups/language.c
gs/cups/libs/cups/language.h
gs/cups/libs/cups/libcups2.def
gs/cups/libs/cups/libcups2.rc
gs/cups/libs/cups/libcups_s.exp
gs/cups/libs/cups/localize.c
gs/cups/libs/cups/mark.c
gs/cups/libs/cups/md5-apple.h
gs/cups/libs/cups/md5-private.h
gs/cups/libs/cups/md5.c
gs/cups/libs/cups/md5.h
gs/cups/libs/cups/md5passwd.c
gs/cups/libs/cups/notify.c
gs/cups/libs/cups/options.c
gs/cups/libs/cups/page.c
gs/cups/libs/cups/ppd-cache.c
gs/cups/libs/cups/ppd-private.h
gs/cups/libs/cups/ppd.c
gs/cups/libs/cups/ppd.h
gs/cups/libs/cups/pwg-file.c
gs/cups/libs/cups/pwg-media.c
gs/cups/libs/cups/pwg-ppd.c
gs/cups/libs/cups/pwg-private.h
gs/cups/libs/cups/pwg.h
gs/cups/libs/cups/raster-private.h
gs/cups/libs/cups/raster.h
gs/cups/libs/cups/request.c
gs/cups/libs/cups/sidechannel.c
gs/cups/libs/cups/sidechannel.h
gs/cups/libs/cups/snmp-private.h
gs/cups/libs/cups/snmp.c
gs/cups/libs/cups/snprintf.c
gs/cups/libs/cups/sspi-private.h
gs/cups/libs/cups/sspi.c
gs/cups/libs/cups/string-private.h
gs/cups/libs/cups/string.c
gs/cups/libs/cups/string.h
gs/cups/libs/cups/tempfile.c
gs/cups/libs/cups/test.ppd
gs/cups/libs/cups/test2.ppd
gs/cups/libs/cups/testadmin.c
gs/cups/libs/cups/testarray.c
gs/cups/libs/cups/testconflicts.c
gs/cups/libs/cups/testcups.c
gs/cups/libs/cups/testfile.c
gs/cups/libs/cups/testhttp.c
gs/cups/libs/cups/testi18n.c
gs/cups/libs/cups/testipp.c
gs/cups/libs/cups/testlang.c
gs/cups/libs/cups/testoptions.c
gs/cups/libs/cups/testppd.c
gs/cups/libs/cups/testpwg.c
gs/cups/libs/cups/testsnmp.c
gs/cups/libs/cups/thread-private.h
gs/cups/libs/cups/thread.c
gs/cups/libs/cups/transcode.c
gs/cups/libs/cups/transcode.h
gs/cups/libs/cups/usersys.c
gs/cups/libs/cups/utf8demo.txt
gs/cups/libs/cups/util.c
gs/cups/libs/cups/versioning.h
gs/cups/libs/filter/Dependencies
gs/cups/libs/filter/Makefile
gs/cups/libs/filter/api-raster.header
gs/cups/libs/filter/api-raster.shtml
gs/cups/libs/filter/commandtops.c
gs/cups/libs/filter/common.c
gs/cups/libs/filter/common.h
gs/cups/libs/filter/error.c
gs/cups/libs/filter/gziptoany.c
gs/cups/libs/filter/image-bmp.c
gs/cups/libs/filter/image-colorspace.c
gs/cups/libs/filter/image-gif.c
gs/cups/libs/filter/image-jpeg.c
gs/cups/libs/filter/image-photocd.c
gs/cups/libs/filter/image-pix.c
gs/cups/libs/filter/image-png.c
gs/cups/libs/filter/image-pnm.c
gs/cups/libs/filter/image-private.h
gs/cups/libs/filter/image-sgi.c
gs/cups/libs/filter/image-sgi.h
gs/cups/libs/filter/image-sgilib.c
gs/cups/libs/filter/image-sun.c
gs/cups/libs/filter/image-tiff.c
gs/cups/libs/filter/image-zoom.c
gs/cups/libs/filter/image.c
gs/cups/libs/filter/image.h
gs/cups/libs/filter/interpret.c
gs/cups/libs/filter/libcupsimage2.def
gs/cups/libs/filter/libcupsimage_s.exp
gs/cups/libs/filter/postscript-driver.header
gs/cups/libs/filter/postscript-driver.shtml
gs/cups/libs/filter/ppd-compiler.header
gs/cups/libs/filter/ppd-compiler.shtml
gs/cups/libs/filter/pstops.c
gs/cups/libs/filter/raster-driver.header
gs/cups/libs/filter/raster-driver.shtml
gs/cups/libs/filter/raster.c
gs/cups/libs/filter/rasterbench.c
gs/cups/libs/filter/rastertoepson.c
gs/cups/libs/filter/rastertohp.c
gs/cups/libs/filter/rastertolabel.c
gs/cups/libs/filter/rastertopwg.c
gs/cups/libs/filter/spec-ppd.header
gs/cups/libs/filter/spec-ppd.shtml
gs/cups/libs/filter/testraster.c


2014-06-05 17:06:47 +0100
Chris Liddell <chris.liddell@artifex.com>
e2da8a39efbfbd96cb05964f3d90e33a507256ef

Include pwgraster.dev with suitable cups revisions

The pwgraster support arrived in cups 1.5, so only build in pwgraster device
when linking with cups 1.5 and later.

No cluster differences

gs/configure.ac


2014-06-05 13:36:58 +0100
Ken Sharp <ken.sharp@artifex.com>
cd1ec1cfbc66568eeb6c2b4413a477568caeadf4

PDF interpreter - ignore broken appearance dicts

Bug #692181 " %%EOF marker"

The bug title is very misleading, there were two problems;
1) Ghostscript didn't synthesise appearances fro FreeText annotations
2) The appearance dictionaries were invalid.

Previous work added support for FreeText annotations, this commit adds some
slight improvements to that, and in addition it does minimal validation on
the AP (appearance) dictionary. If its invalid we don't bother to use it
but synthesise an appearance anyway.

gs/Resource/Init/pdf_draw.ps


2014-06-03 11:27:09 -0700
Chris Liddell <chris.liddell@artifex.com>
2deb460ef02e2802546e09979243764ede2d4173

Bug 695274: validate CIDFont substitute records.

In cidfmap records which substitute TTF fonts check whether we can access
the TTF file, if we cannot, remove the record from the map.

No cluster differences.

gs/Resource/Init/gs_cidfm.ps


2014-06-03 11:18:13 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
cc5257faa69ed02333ac63bd1f3c5e360931407a

Changed copyright date to 2014.

gs/base/gscdef.c


2014-05-31 14:02:28 +0100
Chris Liddell <chris.liddell@artifex.com>
4994e176c4b8ff43ccc91dba807879d02d070d88

Bug 695272: init PS arrays at alloc time

Write null objects to PS arrays when they are allocated - prevents invalid
reads/writes during garbage collection if we hit an error between allocation
and the contents being written.

No cluster differences.

gs/psi/ialloc.c


2014-05-31 13:24:43 +0100
Chris Liddell <chris.liddell@artifex.com>
053fa67fa93fa7be26885422f3881b72ccc682a0

Bug 695275: Add bounds check when retrieving TTF name

When deciding whether a TTF font name is multi or single byte string,
validate the Platform ID before trying to use it. If it is invalid
attempt to continue as a single byte string.

No cluster differences.

gs/Resource/Init/gs_ttf.ps


2014-06-03 05:07:55 +0100
Ken Sharp <ken.sharp@artifex.com>
87b6bca6b9878ea28e460baac62f0abe974c5748

txtwrite - fix BOM emission

Bug #695292 "txtwrite device extracts unicode text from file like bigendian"

The code was emitting the BOM in a way that meant it was always written as
a big-endian BOM when in fsct it should have been the native endian-ness.

No differences expected.

gs/devices/vector/gdevtxtw.c


2014-06-02 17:24:16 -0700
Chris Liddell <chris.liddell@artifex.com>
dae5b12f2e9e4716d6d60874efd7bfee410d69c7

Destroy gslite

CLUSTER_UNTESTED

doc/who_owns_what.txt
gs/base/gxccman.c
gs/base/gxfcache.h
tools/gslite/README
tools/gslite/gslite-api.rtf
tools/gslite/gslt.def
tools/gslite/gslt.h
tools/gslite/gslt.mak
tools/gslite/gslt_alloc.c
tools/gslite/gslt_alloc.h
tools/gslite/gslt_font.h
tools/gslite/gslt_font_api.c
tools/gslite/gslt_font_api.h
tools/gslite/gslt_font_api_test.c
tools/gslite/gslt_font_cache.c
tools/gslite/gslt_font_cff.c
tools/gslite/gslt_font_encoding.c
tools/gslite/gslt_font_glyph.c
tools/gslite/gslt_font_int.h
tools/gslite/gslt_font_test.c
tools/gslite/gslt_font_ttf.c
tools/gslite/gslt_image.c
tools/gslite/gslt_image.h
tools/gslite/gslt_image_jpeg.c
tools/gslite/gslt_image_png.c
tools/gslite/gslt_image_test.c
tools/gslite/gslt_image_threads_test.c
tools/gslite/gslt_image_tiff.c
tools/gslite/gslt_init.c
tools/gslite/gslt_lib_gcc.mak
tools/gslite/gslt_lib_msvc.mak
tools/gslite/gslt_stubs.c
tools/gslite/gslt_test.c
tools/gslite/tiger.jpg


2014-06-02 17:07:28 -0700
Chris Liddell <chris.liddell@artifex.com>
ddcebb6600c102f0d7d8a396f0dafa67845df48b

Remove "commercial only" comment from ETS docs

CLUSTER_UNTESTED

gs/toolbin/halftone/ETS/README.txt


2014-06-02 17:32:33 +0200
Till Kamppeter <till.kamppeter@gmail.com>
e054f1e08f8fdaa557f56cee5ff93f354db1f971

"cups" output device: Do byte-swapping for correct Endian not only for EncodeLUT but also for DecodeLUT

Robin Watts on bug bugs.ghostscript.com/show_bug.cgi?id=695264:

----------
Generally, I think it's considered good form that encode_color and
decode_color should be complementary operations :)

devcups uses EncodeLUT to implement encode_color, and DecodeLUT to
implement decode_color.

In the case of little endian 16bit, it packs a endian reversal into
EncodeLUT. It leaves DecodeLUT undiddled though.

Diddling DecodeLUT in the equivalent manner seems (superficially at
least) to solve the problem.
----------

This makes all 16-bit color spaces give correct colors on rasterview.

gs/cups/gdevcups.c


2014-05-29 15:33:12 +0100
Ken Sharp <ken.sharp@artifex.com>
95eea50e13987bd06d5634ec7f4dc381a76ee629

PDF interpreter - add support for GoTo and GoToR in Link annotations of PDF files

Bug #695268 "PDF file containing link annotation with GoToR action
broken by GS processing, action is not passed"

Patch supplied by Jacek Bator after the code for Outlines with GoTo and
GoToR annotations.

No differences expected.

gs/Resource/Init/pdf_main.ps


2014-05-29 08:32:30 +0100
Ken Sharp <ken.sharp@artifex.com>
272d83387ff590244e3fb8719e8eef2e928f514d

pdfwrite - fix GoTo processing for Outlines in PDF input files

Bug #695267 "Incorrect PDF output for outlines and link annotations with GoTo action"

commit 099657a962e716658f20658051c9692b439ecf2d incorrectly modified the
GoTo action, it turns out that GoTo and GoToR really do have to be handled
differently.

No differences expected.

gs/Resource/Init/pdf_main.ps


2014-05-28 20:43:35 +0100
Robin Watts <robin.watts@artifex.com>
73123c3caa6495e1b30d1ecd35602629d6a8c17e

Bug 695116: Rewrite JPEG header height when required.

This follows on from Kens previous commit and should fix the bug.

When a PDF includes a JPEG it states the height to use for that
JPEG. We now check the JPEG header to see if the height declared
there is 0 or is greater than the PDF specified height. If so,
we rewrite the header to contain the height specified in the PDF.

Short of performing radical surgery on libjpeg to make it honour
the DNL tag, this is the best we are going to be able to do.

gs/base/sdctd.c


2014-05-28 18:52:26 +0100
Ken Sharp <ken.sharp@artifex.com>
ddaea8157085f4efb227e78326dd739d59493b97

PDF interpreter - pass image height as a /DecodeParm to all filters

Bug #695116 "**** Warning: File has insufficient data for an image"

This is not a solution for this bug, merely framework to allow it to be fixed.

The PDF file contains a DCT encoded stream for an image, where the header
declares a height of '-1' and then later uses a DNL marker to set the actual
number of rows of data in the image. This does not work with libjpeg (in
fact it doesn't work with an number of JPEG consumers).

However, because this is an image in a PDF file, we do have the image dimensiosn
from the image dictionary, so we can use that instead, if only we had a way
to pass the information into the stream decode filter.

This commit modifies the dictionary we provide to the stream code in the PDF
interpreter, we now insist that all the Filters in an image shall have a
DecodeParms dictionary, if they don;t already have one we create them as
required. In that dictionary we add a /Height key and put the Height retrieved
from the image dictionary in it.

All the decode operators handle being passed a dictionary with parameters,
so all that is then necessary is to have the DCT decode filter check the
parameter dictionary and store the Height from it in a new entry in the DCT
stream state.

The parameter is now available for use by the DCT decode filter, and a future
commit will use it to fix the actual problem.

No differences expected.

gs/Resource/Init/pdf_draw.ps
gs/base/sdcparam.c
gs/base/sdct.h


2014-05-28 14:48:27 +0200
Till Kamppeter <till.kamppeter@gmail.com>
625b7570141287bf5ca7b61fc733f81b109b45d7

"cups" output device: Fixed obvious copy-and-paste error in color conversion.

gs/cups/gdevcups.c


2014-05-28 11:46:07 +0200
Till Kamppeter <till.kamppeter@gmail.com>
d5065760d06ba71646d08240b87a8de08104c4c5

Fixed PWG Raster support in gdevcups.c to build with all CUPS library versions

We determine now whether we have PWG Raster support by the proper
macro of the CUPS library, not by whether the built-in or an external
lib is used. So we can also build with older CUPS library versions as
external library (bug 695243).

gs/cups/gdevcups.c


2014-05-28 08:33:15 +0100
Ken Sharp <ken.sharp@artifex.com>
230e512962ab5d05f137fc6b3665f5dcae0aa4e9

pdfwrite - test a return code to silence a compiler warning

gs/devices/vector/gdevpdte.c


2014-05-27 14:09:50 +0100
Ken Sharp <ken.sharp@artifex.com>
64dd281abf84ba7383aa85c99599b5aebea3998a

pdfwrite - improved handling of 'glyphshow' and similar operations

Bug #695168 "Problem converting xps to pdf"
Bug #695259 "both (incorrect) B/W and (correct) AA rendering of Libertine font in same PDF output"

Although these are different products, one being Ghostscript and the other
gxps, the underlying problem is similar. The PostScript makes extensive use
of the glyphshow operator, which ends up as a TEXT_FROM_SINGLE_GLYPH operation
in the graphics library, and the XPS interpreter always uses TEXT_FROM_GLYPHS.

In both cases the font is effectively unencoded when pdfwrite seee it. Since
we cannot construct and use an unencoded font in PDF we have no alternative
but to create an encoding for the font, and write the text using that encoding.

The way this is done we use the name table, which effectively means that the
character code we use is derived from the first byte of the glyph name. For
limited usage this works well, but more complex usage can result in problems.
For example the glyphs /o and /omicron are both encoded at index 103.

Previously this would cause us to fall back to rendering the font and embedding
as a type 3 font, or in the worst case an inline image. This is because when
encoding the text we would discover that an the font already had a glyph
encoded at the correct index, and would simply pass on, not realising it was
the incorrect glyph. Later we would check the actual glyph index against the glyph index
of the glyph encoded at that position, realise they were different and throw an error.

In this commit we check the glyph index early, at the point where we encode the text.
If the font already has a glyph encoded at the given character code, we check
the glyph index to see if it matches the current glyph. If it does all is well
but if it doesn't we break out and create a new font instance, with the new
glyph encoded in it.

Potentially this could result in a *lot* of font subsets being created, which
would increase the size of the output PDF file, but the quality improvement
is well worth it.

No differences expected.

gs/devices/vector/gdevpdte.c


2014-05-26 12:43:54 +0100
Ken Sharp <ken.sharp@artifex.com>
099657a962e716658f20658051c9692b439ecf2d

pdfwrite - fix GoTo and GoToR actions when passed through from PDF input

Bug #695232 "Broken PDF file when input file containes bookmarks with GoToR action"

When adding the GoToR functionality I copied the code from the GoTo action
sadly it seems the GoTo was already incorrect.

This commit should fix both, though I don't have a test for the GoTo action.

No differences expected.

gs/Resource/Init/pdf_main.ps


2014-05-24 09:04:53 +0100
Ken Sharp <ken.sharp@artifex.com>
5e868fffeaa21ebb0f7b30a4a9c29272d850b18a

pdfwrite - prototype a function to silence compiler warnings

gs/devices/vector/gdevpdfx.h


2014-05-23 13:59:30 +0100
Ken Sharp <ken.sharp@artifex.com>
cb5c738d04a028a88633f3f98d955f4218b05654

pdfwrite - better handling of input PDF files with broken fonts

Bug #695216 "Spurious errors and bad PDF written from input file comparefles/Bug693711.pdf"

The errors are not spurious, and are caused by the missing/damaged fonts in
the input file.

This commit chooses to ignore these errors, but I may rethink that if it causes
future problems, the fact that there are no errors when rendering does not
mean that there should be no errors when creating a PDF file.

Because the PDF interpreter ignores errors and continues regardles we were
then attempting to write an invalid font, which failed, resulting in an
(unused) entry in the xref with a duplicate offset of an earlier entry. This
commit further refines the broken font handling by detecting the fact that
the font was incorrectly written and elides it from the xref table.

This addresses both of the concerns raised in the bug report, though I would
point out that ignoring errors when the output device is pdfwrite is always
very likely to produce broken PDF files.

This does alter the font substitution for Bug693711.pdf on Linux.

gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpdtb.c
gs/devices/vector/gdevpdtt.c


2014-05-22 18:33:34 +0100
Chris Liddell <chris.liddell@artifex.com>
93a23603b23160943b42c2f1e357fb75cc0a396b

Add an extra compiler flag for OpenJPEG 2.1.0

2.1.0 requires an extra compiler flag "USE_JPIP" that I had forgotten to add
to the Windows build

CLUSTER_UNTESTED

gs/psi/msvc.mak


2014-05-21 15:30:35 +0100
Chris Liddell <chris.liddell@artifex.com>
0d2bc37f7e4096fe31d6ebc6679d79935f52ba0c

Update OpenJPEG to 2.1.0

No cluster differences.

Revise configure script with extra flags for OPJ

Copy in new openjpeg (2.1.0) complete

Zap the openjpeg stuff we don't need

Add predefined openjpeg headers.

These are *nearly* empty of actual definitions, as we generate the settings
from the gs configure script.

Revised makefiles and configure script for new openjpeg

Tweak for updated openjpeg API

Import patches OpenJPEG from Sumatra's tree:

Reference:
https://code.google.com/p/sumatrapdf/source/browse/trunk/ext/_patches/openjpeg.patch?r=8887

gs/base/gs.mak
gs/base/openjpeg.mak
gs/base/sjpx_openjpeg.c
gs/configure.ac
gs/openjpeg/AUTHORS
gs/openjpeg/CHANGES
gs/openjpeg/LICENSE
gs/openjpeg/NEWS
gs/openjpeg/THANKS
gs/openjpeg/libopenjpeg/CMakeLists.txt
gs/openjpeg/libopenjpeg/Makefile.am
gs/openjpeg/libopenjpeg/Makefile.in
gs/openjpeg/libopenjpeg/bio.c
gs/openjpeg/libopenjpeg/bio.h
gs/openjpeg/libopenjpeg/cidx_manager.c
gs/openjpeg/libopenjpeg/cidx_manager.h
gs/openjpeg/libopenjpeg/cio.c
gs/openjpeg/libopenjpeg/cio.h
gs/openjpeg/libopenjpeg/dwt.c
gs/openjpeg/libopenjpeg/dwt.h
gs/openjpeg/libopenjpeg/event.c
gs/openjpeg/libopenjpeg/event.h
gs/openjpeg/libopenjpeg/fix.h
gs/openjpeg/libopenjpeg/function_list.c
gs/openjpeg/libopenjpeg/function_list.h
gs/openjpeg/libopenjpeg/image.c
gs/openjpeg/libopenjpeg/image.h
gs/openjpeg/libopenjpeg/indexbox_manager.h
gs/openjpeg/libopenjpeg/int.h
gs/openjpeg/libopenjpeg/invert.c
gs/openjpeg/libopenjpeg/invert.h
gs/openjpeg/libopenjpeg/j2k.c
gs/openjpeg/libopenjpeg/j2k.h
gs/openjpeg/libopenjpeg/j2k_lib.c
gs/openjpeg/libopenjpeg/j2k_lib.h
gs/openjpeg/libopenjpeg/jp2.c
gs/openjpeg/libopenjpeg/jp2.h
gs/openjpeg/libopenjpeg/jpt.c
gs/openjpeg/libopenjpeg/jpt.h
gs/openjpeg/libopenjpeg/mct.c
gs/openjpeg/libopenjpeg/mct.h
gs/openjpeg/libopenjpeg/mqc.c
gs/openjpeg/libopenjpeg/mqc.h
gs/openjpeg/libopenjpeg/openjpeg.c
gs/openjpeg/libopenjpeg/openjpeg.h
gs/openjpeg/libopenjpeg/opj_clock.c
gs/openjpeg/libopenjpeg/opj_clock.h
gs/openjpeg/libopenjpeg/opj_config.h
gs/openjpeg/libopenjpeg/opj_config_private.h
gs/openjpeg/libopenjpeg/opj_includes.h
gs/openjpeg/libopenjpeg/opj_intmath.h
gs/openjpeg/libopenjpeg/opj_inttypes.h
gs/openjpeg/libopenjpeg/opj_malloc.h
gs/openjpeg/libopenjpeg/opj_stdint.h
gs/openjpeg/libopenjpeg/phix_manager.c
gs/openjpeg/libopenjpeg/pi.c
gs/openjpeg/libopenjpeg/pi.h
gs/openjpeg/libopenjpeg/ppix_manager.c
gs/openjpeg/libopenjpeg/raw.c
gs/openjpeg/libopenjpeg/raw.h
gs/openjpeg/libopenjpeg/t1.c
gs/openjpeg/libopenjpeg/t1.h
gs/openjpeg/libopenjpeg/t1_generate_luts.c
gs/openjpeg/libopenjpeg/t1_luts.h
gs/openjpeg/libopenjpeg/t2.c
gs/openjpeg/libopenjpeg/t2.h
gs/openjpeg/libopenjpeg/tcd.c
gs/openjpeg/libopenjpeg/tcd.h
gs/openjpeg/libopenjpeg/tgt.c
gs/openjpeg/libopenjpeg/tgt.h
gs/openjpeg/libopenjpeg/thix_manager.c
gs/openjpeg/libopenjpeg/tpix_manager.c
gs/openjpeg/opj_config.h.in.user
gs/openjpeg/src/lib/openjp2/CMakeLists.txt
gs/openjpeg/src/lib/openjp2/bio.c
gs/openjpeg/src/lib/openjp2/bio.h
gs/openjpeg/src/lib/openjp2/cidx_manager.c
gs/openjpeg/src/lib/openjp2/cidx_manager.h
gs/openjpeg/src/lib/openjp2/cio.c
gs/openjpeg/src/lib/openjp2/cio.h
gs/openjpeg/src/lib/openjp2/dwt.c
gs/openjpeg/src/lib/openjp2/dwt.h
gs/openjpeg/src/lib/openjp2/event.c
gs/openjpeg/src/lib/openjp2/event.h
gs/openjpeg/src/lib/openjp2/function_list.c
gs/openjpeg/src/lib/openjp2/function_list.h
gs/openjpeg/src/lib/openjp2/image.c
gs/openjpeg/src/lib/openjp2/image.h
gs/openjpeg/src/lib/openjp2/indexbox_manager.h
gs/openjpeg/src/lib/openjp2/invert.c
gs/openjpeg/src/lib/openjp2/invert.h
gs/openjpeg/src/lib/openjp2/j2k.c
gs/openjpeg/src/lib/openjp2/j2k.h
gs/openjpeg/src/lib/openjp2/jp2.c
gs/openjpeg/src/lib/openjp2/jp2.h
gs/openjpeg/src/lib/openjp2/libopenjp2.pc.cmake.in
gs/openjpeg/src/lib/openjp2/mct.c
gs/openjpeg/src/lib/openjp2/mct.h
gs/openjpeg/src/lib/openjp2/mqc.c
gs/openjpeg/src/lib/openjp2/mqc.h
gs/openjpeg/src/lib/openjp2/openjpeg.c
gs/openjpeg/src/lib/openjp2/openjpeg.h
gs/openjpeg/src/lib/openjp2/opj_clock.c
gs/openjpeg/src/lib/openjp2/opj_clock.h
gs/openjpeg/src/lib/openjp2/opj_codec.h
gs/openjpeg/src/lib/openjp2/opj_config.h
gs/openjpeg/src/lib/openjp2/opj_config.h.cmake.in
gs/openjpeg/src/lib/openjp2/opj_config_private.h
gs/openjpeg/src/lib/openjp2/opj_config_private.h.cmake.in
gs/openjpeg/src/lib/openjp2/opj_includes.h
gs/openjpeg/src/lib/openjp2/opj_intmath.h
gs/openjpeg/src/lib/openjp2/opj_inttypes.h
gs/openjpeg/src/lib/openjp2/opj_malloc.h
gs/openjpeg/src/lib/openjp2/opj_stdint.h
gs/openjpeg/src/lib/openjp2/phix_manager.c
gs/openjpeg/src/lib/openjp2/pi.c
gs/openjpeg/src/lib/openjp2/pi.h
gs/openjpeg/src/lib/openjp2/ppix_manager.c
gs/openjpeg/src/lib/openjp2/raw.c
gs/openjpeg/src/lib/openjp2/raw.h
gs/openjpeg/src/lib/openjp2/t1.c
gs/openjpeg/src/lib/openjp2/t1.h
gs/openjpeg/src/lib/openjp2/t1_generate_luts.c
gs/openjpeg/src/lib/openjp2/t1_luts.h
gs/openjpeg/src/lib/openjp2/t2.c
gs/openjpeg/src/lib/openjp2/t2.h
gs/openjpeg/src/lib/openjp2/tcd.c
gs/openjpeg/src/lib/openjp2/tcd.h
gs/openjpeg/src/lib/openjp2/tgt.c
gs/openjpeg/src/lib/openjp2/tgt.h
gs/openjpeg/src/lib/openjp2/thix_manager.c
gs/openjpeg/src/lib/openjp2/tpix_manager.c


2014-05-20 11:47:21 -0700
Ray Johnston <ray.johnston@artifex.com>
21565d4ad3c3eed360d3a56c372663d1ba876c0d

Fix for fts_09_0920 SMask in ExGState ignored for text.

When the SMask is set in the ExtGState rather than in a Group Form,
we need to push a transparency group before painting the text (after
the setfillstate) and pop it afterwards, similarly to what we do
for fills and strokes.

gs/Resource/Init/pdf_ops.ps


2014-05-21 15:30:35 +0100
Chris Liddell <chris.liddell@artifex.com>
f032367796457690caa484b1a50aa1f97b80322a

Ensure memory allocator is available for jpeg encoding

No cluster differences.

gs/devices/gdevjpeg.c


2014-05-21 13:15:09 +0100
Ken Sharp <ken.sharp@artifex.com>
cc26212b8b4a756d6da891c946b53c52641befd3

pdfwrite - add an idiom for certain patterns produced by the MS driver


Bug #695230 "Invalid pattern fill rendering"

The Windows PostScript driver produces some patterns (for background fills)
which vary the size of the pattern cell according to the device resolution.
This means that as the resolution goes up, more pattern cells are drawn,
resulting in a finer and finer pattern.

This resolution neatly defeats our high level pattern capture in pdfwrite.
It only works properly if the device is running at 72 dpi, and the example
runs at 600.

It seems the easiest way to deal with this is to create an idiom which will
replace the resolution-varying pattern with a fixed pattern (it isn't possible
to have a resolution-dependent pattern in PDF anyway) and this commit adds
such an idiom.

It also updates the idioms to use the new .spec_op operator to interrogate
device parameters rather than the slow getdeviceparams previously used.

No differences expected.

gs/Resource/IdiomSet/Pscript5Idiom


2014-05-19 15:53:05 +0100
Chris Liddell <chris.liddell@artifex.com>
1b06d7888faf61bef37fc17b10a1745d889f4c75

Remove jmorecfg.h from includes....

in jmemcust.c

No cluster differences.

gs/base/jmemcust.c


2014-05-09 12:22:08 +0100
Chris Liddell <chris.liddell@artifex.com>
cb50ac70a8e8874a265da59baca7e95790e79af1

Add an app independent custom memory manager for libjpeg

gs/base/jmemcust.c
gs/base/jmemcust.h
gs/base/jpeg.mak
gs/base/sjpeg.h
gs/base/sjpegc.c
gs/base/sjpegd.c
gs/base/sjpege.c


2014-05-16 21:01:33 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
0145175ab9d530a4ed2c79dc6290235b30e980cc

Temporarily disable code introduced in 6fefd767005a8e5e8da0cbb954d0d47fc45fc37b.

For more details see Bug 695243.

gs/cups/gdevcups.c


2014-05-15 19:54:04 +0200
Till Kamppeter <till.kamppeter@gmail.com>
6fefd767005a8e5e8da0cbb954d0d47fc45fc37b

CUPS Raster output device: Fix cupsRasterOpen() call to get correct PWG Raster output

The CUPS Raster output device generated incorrect PWG Raster output
because it called cupsRasterOpen() without the required
CUPS_RASTER_WRITE_PWG mode setting. Due to the output never being
tested with an IPP Everywhere printer but only with software which
also accepts CUPS Raster, the bug did not get discovered until testing
the output against the mime type recognition of CUPS where it failed.

Note that this patch only fixes the problem if a shared libcupsimage
library of the system is used, not with the library included with
Ghostscript. This is because the included library is too old to
contain PWG Raster output support. If the included CUPS libraries have
to be used, the CUPS Raster output device is built as before to assure
that Ghostscript builds and CUPS Raster can still get generated.

gs/Makefile.in
gs/cups/gdevcups.c
gs/devices/devs.mak


2014-05-15 08:51:43 +0100
Chris Liddell <chris.liddell@artifex.com>
4836ecb5c5a03eb7217937b8503b20068e9bf846

Bug 695227: fix crash in bbox device

Don't try to assign the "imaging_dev" entry in the text enumerator if the
enumerator initialisation doesn't complete.

Slightly modified version of the patch supplied by
Antti Husa <a.husa@hushmail.com>

No cluster differences.

gs/base/gdevbbox.c


2014-05-12 11:13:07 +0100
Chris Liddell <chris.liddell@artifex.com>
a7434eca8268e31fdfc4b47740a7e7695b189bc0

Words about static linking the executable.

Mention the need to explicitly link libraries when building a static gs exe.

CLUSTER_UNTESTED

gs/doc/Make.htm


2014-05-12 10:53:12 +0100
Chris Liddell <chris.liddell@artifex.com>
3c4cfba8a74fd3255231fb381b55998753174849

Pass SHARE_LCMS as a compiler flag.

As pointed out by Albert Astals Cid <aacid@kde.org> although the code had been
changed to use the system malloc/free calls when sharing LCMS2, the flag
(SHARE_LCMS==1) I had forgotten to add it to the compiler parameters.

I've opted to add SHARE_LCMS to the compiler flags for LCMS, and include them
when compiler our interface files - this seems less likely to throw up a
similar oversight in the future.

No regression differences.

gs/Makefile.in
gs/base/lib.mak


2014-05-09 07:32:54 -0700
Ray Johnston <ray.johnston@artifex.com>
7df04bbe3a7126dc702cb09369ba29fd142bfa62

Only include trace devices (tr_mono, tr_rgb, tr_cmyk) in DEBUG builds on MSVC

gs/psi/msvc.mak


2014-05-09 07:22:08 -0700
Ray Johnston <ray.johnston@artifex.com>
db885d6e72fce5140a56abc8d4f49b0a3658aad7

Add tracedev (tr_mono, tr_rgb, tr_cmyk) to default MSVC build.

gs/psi/msvc.mak


2014-05-09 00:41:44 +0100
Robin Watts <robin.watts@artifex.com>
cc278761f766f7dbbba051af13b1ea0fdc7cdb08

Further tweak to ETS; mention patents, and add image viewer

Mention the patents in the comments of the code.

Add the image viewer back, as for people without Photoshop it can
be hard to visualise the output.

gs/toolbin/halftone/ETS/ets.c
gs/toolbin/halftone/ETS/ipview.html


2014-05-08 13:19:09 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c203e3342db1933e610433de6915fcb66a8e593f

Removed files that were no longer used (SSE and VEC files and Build files). Updated README.txt

gs/toolbin/halftone/ETS/COPYING.txt
gs/toolbin/halftone/ETS/Makefile_avec
gs/toolbin/halftone/ETS/Makefile_sse2
gs/toolbin/halftone/ETS/README.txt
gs/toolbin/halftone/ETS/_eb_sse2.s
gs/toolbin/halftone/ETS/build.bat
gs/toolbin/halftone/ETS/eb_avec.c
gs/toolbin/halftone/ETS/eb_avec.h
gs/toolbin/halftone/ETS/eb_sse2.s
gs/toolbin/halftone/ETS/ets.c
gs/toolbin/halftone/ETS/ipview.html


2014-05-05 11:38:10 -0700
Ray Johnston <ray.johnston@artifex.com>
d2111f620ad95a5deb918c8d64be04012025fed1

Fix clist closepath to wrong start point. Bug 695205, cust 870.

When writing paths into the clist, we simplify the path for each band.
This means that whole line segments that are not present within a band
can be omitted which speeds up path rendering for bands. This code had
a bug that could cause the closepath of a subpath to connect to the
wrong point.

If the last element written for a subpath ends at point X, and the
start point of the first element of the next subpath is that same
point X, then the code would forget to emit a "catchup" moveto.
This would cause a closepath to connect to the initial point of
the previous subpath.

Amazingly, this bug has been there since rev 3.60 (Nov 1995) although
a partial fix was added in 3.68 (May 1996).

gs/base/gxclpath.c


2014-05-07 17:51:21 +0100
Chris Liddell <chris.liddell@artifex.com>
a33588aad3bde9321bd5ea7eaf37b5adba22482c

Bug 695211: (addendum) set SHARE_TRIO for Windows builds

CLUSTER_UNTESTED

common/msvc_top.mak
gs/psi/msvc.mak
xps/xps_msvc.mak


2014-05-05 11:12:47 +0100
Chris Liddell <chris.liddell@artifex.com>
fc0420d74524a9988c8cdf465a2fbf234e343a38

Bug 695211: Allow trio to be shared.

No cluster differences

gs/Makefile.in
gs/base/gs.mak
gs/base/lib.mak
gs/base/trio.mak
gs/configure.ac
main/pcl6_gcc.mak
main/pcl6_msvc.mak


2014-05-06 10:39:42 +0100
Ken Sharp <ken.sharp@artifex.com>
a314230d18fd13810774318d985cc46fe9ed0102

PDF interpreter - work around GSView usage of the interpreter

Bug #695179 "Inert links in PDF and collapsing PDF when opened in gsview with gs ver. newer that 9.07"

Commit 073f460af5bb37edb1849c5d6235048598100437 introduced a cumulative page
count, which is added to pdfmarks when encountered in order to cope with
running multiple input files. The pdfmarks from the second file would
be incorrect unless the number of pages in the first file were added to the
destinationpage numbers.

Unfortunately the (undocumented, unsupported) way that GSView works with the
PDF interpreter to retrieve links failed, because the variable is unavailable
under the conditions that GSView exercises the interpreter.

In this commit we extend the CumultaivePageCount usage so that we first check
if the variable is defined, and if its not, we set a default of '0'. This
should mean that the supported use of the PDF interpreter continues to work
correctly with multiple input files, and restores the GSView behaviour.

No differences expected.

gs/Resource/Init/pdf_main.ps


2014-05-05 11:39:00 +0100
Chris Liddell <chris.liddell@artifex.com>
50e62cb7c50393e0cbb34f82981e7d1f6d7a3a6d

Bug 695206: add directories to deps for zlib/png objs

Ensure that the build directories exist before we try to build any
object files from zlib or png.

No cluster differences.

gs/base/png.mak
gs/base/zlib.mak


2014-04-29 15:46:44 -0700
Ray Johnston <ray.johnston@artifex.com>
2cad20efb9a9a1ec483c58bd6a087a9445ba23dc

Fix wrong tag value for customer 532, file "VINEYARD_p1.pdf"

If the SOURCE alpha is 100%, then replace the tag, otherwise, OR.

gs/base/gdevp14.c


2014-05-02 10:10:41 +0100
Ken Sharp <ken.sharp@artifex.com>
87218e9f187d2d8c36c3eb6721f2725d9834553a

txtwrite - fix a copy/paste error

After allocating memory we checked to see if it was successful but we checked
the wrong variable. Corrected here.

No differences expected.

gs/devices/vector/gdevtxtw.c


2014-05-02 09:51:40 +0100
Ken Sharp <ken.sharp@artifex.com>
63a5201a2b5db40e11dd45cf991a7e5a84d7ce80

txtwrite - clear file handle when file is closed

When we close the output file, set the handle to 0 so that we don't later
attempt to close it again. Apparently closing a closed file causes a
problem on Linux.

No differences expected.

gs/devices/vector/gdevtxtw.c


2014-05-02 09:18:06 +0100
Ken Sharp <ken.sharp@artifex.com>
c82e83c2c10751f048a3f2260c9adaceaca7880e

Fix some scan-build warnings from commit 0476b5036d8175a4817a9385cb6a15b64fab310e

The code dealing with single device parameters was over-aggressive about
reducing the ICC profile setup. In practice this is unlikely ever to be
a problem, there is no real chance that the setup won't be performed
before we reach this point, but its obviously much better to have the code
correct.

This commit essentially copies verbatim the setup code from the normal
get_params device method in the default device.

gs/base/gsdparam.c


2014-04-30 12:19:40 +0100
Chris Liddell <chris.liddell@artifex.com>
34a04b46e5ed098251901ce0b51caa2137928922

Bug 695194: ignore invalid color space in shading

When checking objects for spot colors, ignore an invalid color space in a
shading object.

The code during rendering already deals with this problem (by ignoring the
shading!).

No cluster differences.

gs/Resource/Init/pdf_main.ps


2014-04-30 09:58:11 +0100
Chris Liddell <chris.liddell@artifex.com>
b02681f8dd6799236f040576e35884634e9c3508

Bug 695193: USE_LARGE_COLOR_INDEX=0 on Windows

As we use a pregenerated arch.h for Windows (in order to support cross compiling
64 bit executables on 32 bit systems), we need to handle this in a combination
of the makefile and predefined arch.h

This commit includes equivalent changes for the other pre-defined arch.h files

No cluster differences.

gs/arch/osx-x86-x86_64-ppc-gcc.h
gs/arch/windows-arm-msvc.h
gs/arch/windows-x64-msvc.h
gs/arch/windows-x86-msvc.h
gs/psi/msvc.mak


2014-05-01 15:14:02 +0100
Ken Sharp <ken.sharp@artifex.com>
ad27e65ad745e4dd287e0f7a7a0efb2637472bc2

Implement use of the new 'device param' spec op

Wherever possible, replace the .getdeviceparams call with a call to the
PostScript .special_op to retrieve a single parameter.

This cannot be done unless we can guarantee that the devices we are
interested in will implement the spec_op device method. So some places
which appear at first sight to be candidates can't be done this way.

gs/Resource/Init/gs_cidfn.ps
gs/Resource/Init/gs_fapi.ps
gs/Resource/Init/gs_img.ps
gs/Resource/Init/gs_pdfwr.ps
gs/Resource/Init/gs_setpd.ps
gs/Resource/Init/pdf_draw.ps
gs/Resource/Init/pdf_font.ps
gs/Resource/Init/pdf_main.ps
gs/Resource/Init/pdf_ops.ps
gs/psi/zfunc4.c


2014-05-01 15:11:39 +0100
Ken Sharp <ken.sharp@artifex.com>
0476b5036d8175a4817a9385cb6a15b64fab310e

Add support for the 'device param' spec op to devices

Adds support for the spec_op which retrieves a single device parameter to
every device I cna find which currently implements spec_ops.

Add spec_op support to the generic vector device, the txtwrite and the psdf
devices

gs/base/gdevdflt.c
gs/base/gdevprn.c
gs/base/gdevprn.h
gs/base/gdevvec.c
gs/base/gdevvec.h
gs/base/gsdparam.c
gs/base/gxdevice.h
gs/base/lib.mak
gs/devices/gdevcmykog.c
gs/devices/gdevfpng.c
gs/devices/vector/gdevpdfi.c
gs/devices/vector/gdevpdfp.c
gs/devices/vector/gdevpdfx.h
gs/devices/vector/gdevps.c
gs/devices/vector/gdevpsdf.h
gs/devices/vector/gdevpsdp.c
gs/devices/vector/gdevtxtw.c


2014-05-01 15:07:37 +0100
Ken Sharp <ken.sharp@artifex.com>
e2d3dca4aff619e0b407a8c04e559f9c509b9787

Add a new PostScript operator to permit device spec_ops to be executed

gs/psi/int.mak
gs/psi/opextern.h
gs/psi/zdevice.c


2014-05-01 15:05:15 +0100
Ken Sharp <ken.sharp@artifex.com>
3b03988711bc5ab352c61e4937282e61e5e092aa

Add a new 'spec op' to retrieve a single parameter from a device.

Includes a new structure to be passed as the 'data' parameter to allow us
to pass multiple parameters.

gs/base/gxdevsop.h


2014-04-15 14:18:16 -0700
Ray Johnston <ray.johnston@artifex.com>
e69c464da00208889ed4c55ef0e869ac9246e750

Avoid remap calls if color already mapped to a pure color.

Device colors that map to a pure color are common. The optimization
reduced the number of remap_color calls to 1/390 on a QL pdf test
file (WWTTN1CT). Performance improvement is small if FP is fast.

gs/base/gscolor2.c
gs/base/gxcmap.c


2014-04-29 11:48:48 +0100
Chris Liddell <chris.liddell@artifex.com>
0c5a6d8c142371b84542ab9ea175501f02cfb9bd

Bug 695190: implement glyph width cache for pcl/pxl

Using the FAPI integration of UFST instead of the original PCL specific
one lost an optimisation where glyph widths were cached by the interpreter.

Reintroduce this, and attach the widths cache to the plfont object (instead of
it being global).

No cluster differences.

pl/plchar.c
pl/plfont.c
pl/plfont.h


2014-04-24 16:37:53 +0100
Chris Liddell <chris.liddell@artifex.com>
7580b5f2b52a51d9da6e8eb2188360f1c894ee1e

Bug 695096: make the "display" device the default in gsx

No cluster differences

gs/psi/dxmain.c


2014-04-24 16:22:52 +0100
Chris Liddell <chris.liddell@artifex.com>
496d5b9ee3c8247354152ec8d2b3b8268cdc4430

Add support for changing the default device list at runtime

(Bug 695096)

The graphics library searches a list of preferred devices to find a suitable
default device. Previously that list was created at graphics library compile
time and could not be changed after that.

This change allows the calling application to retrieve the current string that
represents this list, and set its preferred list and order, if required.

No cluster differences.

gs/base/gsdevice.c
gs/base/gsdevice.h
gs/base/gslibctx.c
gs/base/gslibctx.h
gs/base/lib.mak
gs/psi/dwdll.c
gs/psi/dwdll.h
gs/psi/dwnodll.c
gs/psi/gsdll2.def
gs/psi/gsdll32.def
gs/psi/gsdll32metro.def
gs/psi/gsdll64.def
gs/psi/gsdll64metro.def
gs/psi/gsdllARM32metro.def
gs/psi/iapi.c
gs/psi/iapi.h
gs/psi/zdevice.c


2014-04-24 13:20:01 +0100
Chris Liddell <chris.liddell@artifex.com>
5192635686b3a9da14e4531c7ce7ca85cd629a66

Don't pass a 32 bit variable 64 is expected.

On 64 bit platforms the "gsize" type is 64 bits long, thus if we pass a 32 bit
integer into a call expecting to write to a gsize, we get stack corruption.

Use a temporary gsize variable to retrieve the value, and then copy it to the
32 bit integer. As this is for stdin buffers, we're not likely to require
64 bit values!

CLUSTER_UNTESTED

gs/psi/dxmain.c


2014-04-22 23:50:51 -0400
James Cloos <cloos@jhcloos.com>
ab862a54568407fdaff554c56baed9809e23860b

Set the WM_CLASS property when using the x11 DEVICEs.

Add an explicit call to XSetClassHint(1) to the x11 devices to ensure
that the WM_CLASS property is set.

Setting WM_CLASS allows one to configure how gs’s output window behaves.

For comparison, gtk+ sets the display DEVICE’s output window’s
WM_CLASS based on the executable’s name.

Signed-off-by: James Cloos <cloos@jhcloos.com>
Signed-off-by: Henry Stiles <henry.stiles@artifex.com>

gs/devices/gdevxini.c


2014-04-23 09:43:56 +0100
Ken Sharp <ken.sharp@artifex.com>
c79b0ee1dbc1cbbcbe406abd4bc47f617ed5cb2c

pdfwrite - fix Named destinations with Names tree

Bug #695162 "Internal hyperlinks lost when converting to pdf"
Bug #695175 "can't save PDF file if compiled with hyperref packages"

In order to add support for the EMBED pdfmark we had to move the named destinations
from the PDF 1.1 /Dests dictionary to the PDF 1.2+ Names tree. The Names
tree requires that the 'keys' be strings, unlike the old Dests dict where
the keys are of course name objects.

Now the PDF reference says that,with PDF 1.2 and above, both strings and
name objects can be used to refer to named destinations. However it appears
that this is not true for Acrobat, the reference to a named destination must
be a string object if we are using a Names tree.

This commit alters the creation of the Names tree so that we store the actual
destinations as individual objects (this probably wasn't required, but it
mimics Distiller) instead of inline dictionaries, reinstates a missing /D
key in said dictionary and crucially alters the reference to the named
destination so that it is a string and not a name.

The commit also caters for 'unusual' names in named destinations. The PDF
interpreter 'escapes' the name of a name object by adding leading NULLs if
the name contains certain kinds of characters. We weren't catering for that
when converting names to strings for inclusion in the Names tree, which was
leading to an empty object, and caused Acrobat to refuse to save the file.

Finally, while investigating the problems, I noticed a logical error with
DOCVIEW pdfmarks which could result in Open actions being written incorrectly
and this is also fixed here.

No differences expected as the cluster doesn't test this kind of metadata.

gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfo.c


2014-04-22 19:02:28 +0100
Robin Watts <robin.watts@artifex.com>
963c6827fdcd2e07c2a7bc6848a97eb7ecb3c38d

Update Ghostscript solution for Windows.

Later versions of VS dislike relative paths for the working directory
in the debug set up. The solution is to use "$(ProjectDir)\.." as this
evaluates to the same dir as ".." used to. Update the ReadMe to
reflect this.

Also update the Solution files so that "Output" points to the built
executables. This enables the editing required for the debugging
setup to be simpler.

gs/ghostscript-ufst.vcproj
gs/ghostscript.vcproj
win32/GhostPDL.sln
win32/ReadMe.txt
win32/language_switch.vcproj
win32/pcl.vcproj
win32/svg.vcproj
win32/xps.vcproj


2014-04-22 21:13:51 +0100
Chris Liddell <chris.liddell@artifex.com>
5898732ce7f140bc9bbe9818c8525a02236aa8f0

Add a cast to address compiler warning

No cluster differences.

gs/psi/iapi.c


2014-04-22 17:44:13 +0100
Chris Liddell <chris.liddell@artifex.com>
fb11fa25a622124ab1ceba66b0f6ba165162f056

Bug 695173: skip conversion to UTF8 for "local" encoding

If we're using "GS_ARG_ENCODING_LOCAL" that means arguments are already in the
text encoding we want so no conversion is required (and the get_codepoint()
method is set to NULL).

When that happens, skip the conversion step, and avoid a seg fault.

No cluster differences.

gs/psi/iapi.c


2014-04-21 13:42:40 -0600
Henry Stiles <henry.stiles@artifex.com>
4c1b9214b3e996778f69f33abbf02e9d4da95332

Fix 694958 - raster portions of plot were rotated because the
coordinate system was not properly oriented.

The HPGL/2-RTL's current coordinate system is different depending on
relative extant of plot width and length, rotating the system if the
width is greater than or equal to the height. We did not handle the
equal case properly, we mistakenly used a strict inequality.

pcl/pgdraw.c


2014-04-18 11:08:54 +0100
Ken Sharp <ken.sharp@artifex.com>
12e2eafa38a9932bb136879374423de133075a4a

PDF interpreter - reinstate (and complete) the BMC/BDC/EMC pdfmark support

Bug #695151 "Add BMC/EMC and BDC pdfmark support"

This is the patch supplied by Alexander Grahn with a couple of very minor
additions. Firstly we clean up the Properties resource in pdf_close in case
by some chance there are still properties dictionaries lying around. Secondly
we treat the Properties resource specially (like fonts) in
pdf_store_page_resources().

Because we write the properties dictionaries in line, we must not emit them
in pdf_store_page_resources (they no longer exist for one thing) as this
leads to duplicate objects being created. We may need to revisit this in the
future as I'm not 100% certain this is the best way to proceed. However it
works properly for all the (very few) test cases I have, or have been able
to create.

This patch also 'fixes' the opdfread ps2write header. In the past if a BMC
EMC or BDC was encountered in the PDF file it would try to handle it, but
the handler doesn't exist, leading to PostScript errors. Rather than try
to reconstruct the requisite pdfmarks I've chosen simply to ignore these
constructs. If anyone objects strenuously we can figure out a handler
in future.

No differences expected.

gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfu.c
gs/devices/vector/opdfread.h
gs/lib/opdfread.ps


2014-04-17 09:45:00 +0100
Ken Sharp <ken.sharp@artifex.com>
b374d709ac920682b4848ea9070681ceb6b44790

PDF interpreter - treat 0 length CIDToGIDMap as if it were not present

Bug #695167 "Output page blank"

The PDF contained a type 11 CIDFont with a CIDToGIDMap whose length was 0,
this caused the type11buildfont code to fail.

Since the CIDTogidMap is optional, treating a 0 length map as 'not present'
seems a sensible solution.

No differences expected

gs/Resource/Init/pdf_font.ps


2014-04-16 09:41:19 +0100
Ken Sharp <ken.sharp@artifex.com>
d2f4c3e592b0f4063ce92c9245dc903ad75495fc

PDF interpreter - improve transparency detection and apply it to annotations

The existence of CA and ca in annotations without appearance streams were
not detected. The FreeText annotation synthesis can apply transparency if
present, so we need to detect it and push the compositor.

Also, add the code to the FreeText annotation appearance synthesis to apply
transparency.

A few (3) Sumatra PDF files now render very slightly differently, and the
same files now produce larger PostScript than they did before (because they
are rendered to images)

gs/Resource/Init/pdf_draw.ps
gs/Resource/Init/pdf_main.ps


2014-04-15 12:51:51 +0100
Ken Sharp <ken.sharp@artifex.com>
0ace93f19464cab701f117ba1e6ee489062748e5

PDF interpreter - sunthesise appearances for FreeText annotations

Bug #693731 "Freetext annotations are not printed"

The FreeText annotation in question has no appearance stream and we did
no previously synthesise one. This commit adds code to do so, it should
work with UTF16-BE text but I don't have a test file for this.

The existing code to draw annotation borders was insufficient, it did not
correctly drop elements drawn with a colour of /C[] and would not handle
colours (/C) defined in anything except RGB space.

The Sumatra test file annotations_galore_II.pdf exhibits a progression
with this commit (its the only other example of this I could find)

gs/Resource/Init/pdf_draw.ps


2014-04-15 10:09:19 +0100
Ken Sharp <ken.sharp@artifex.com>
b0a655cb457f5d719a647ef0663c4770c764cef7

pdfwrite - disable the BMC/BDC/EMC pdfamrks again

The previous commit b90e081b8ad9b64ae4b66bd27262a9582c129cfc could create
PDF files which Acrobat couldn't open.

This disables the pdfmark processing until I find out why.

gs/devices/vector/gdevpdfm.c


2014-04-15 09:35:45 +0100
Ken Sharp <ken.sharp@artifex.com>
b90e081b8ad9b64ae4b66bd27262a9582c129cfc

pdfwrite - implement the BDC, BMC and BDC pdfmarks

Bug #695151 "Add BMC/EMC and BDC pdfmark support"

Adopt the patch from Alexander Grahn, with the small addition of code to
free the Properties resource at the end of the job.

No differences expected.

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfx.h


2014-04-14 16:47:35 +0200
Norbert Janssen <norbert.janssen@oce.com>
723ae69281aec8c7e9ad5192fe77761f4e476186

Bug 695049: plexity handling in pcl

Handle plexity in pcl (and its interactions with left/top offset
registrations, pageside selections).

pcl/pcjob.c
pcl/pcpage.c
pxl/pxsessio.c


2014-04-11 22:33:07 -0600
Henry Stiles <henry.stiles@artifex.com>
44a0504d79c28baa6d7a5eda6d5a697424be1c7b

Fix 695417 cursor tracking broken.

The bug subject is incorrect, the problem was initially diagnosed as a
problem with GL/2 and PCL cursor interaction, but in fact it was the
rounding of the translation components of PCL raster to device space
matrix produced incorrect results at some resolutions.

This problem needs a bit more investigation but empirically not
rounding translation components seems to give better results. I don't
know if this is because it more closely emulates HP's calculations or
if there is another interaction in the ghostscript graphics library
which makes the integral translation components inappropriate.

The change results in many single pixel translations in the regression
tests.

pcl/rtgmode.c


2014-04-11 10:46:11 -0600
Henry Stiles <henry.stiles@artifex.com>
fdffeb917e804522ed7117f19ac230c9d23d158f

Fix bug #695129 black background painted with the pxlcolor device.

PXL has no high level understanding of PostScript or PDF transfer
functions so we fall back to having the graphics library handle color
conversion when a transfer function is set.

gs/devices/vector/gdevpx.c


2014-04-09 14:32:40 +0100
Ken Sharp <ken.sharp@artifex.com>
c8673cb8209a9f294721fae7a1842fcd8940ecab

PDF interpreter - implement the (not yet documented) revision 6 security handler

Copied from the MUPDF implementation. This does cause a few differences,
I'm not really sure why as the code can't possibly be causing them. I assume
its simply memory differences of some kind.

gs/Resource/Init/pdf_sec.ps
gs/psi/int.mak
gs/psi/zpdf_r6.c


2014-04-08 14:10:45 -0600
Henry Stiles <henry.stiles@artifex.com>
cd8b2819ddd9c9aba33a19c8913861767296d576

Disable the remaining long form color commands, fixing 695110.

All of the color long form commands appear to be no longer supported
on modern HP devices and our implementation of them frequently results
in unexpected output and difficult to find bugs. This change gets rid
of the remaining commands which affected white and black point
settings. Aside from fixing the test file in the bug this improves
several panels in the Quality Logic FTS against the Color Laserjet
4700, i.e. panels 810 and 814.

The command is simply truncated so the long form command is
transformed into a corresponding short form allowing for setting of
the color space, bits per component, etc. The long form code remains
for now and is easily brought back if we get user feedback that there
is an HP device we care to support with these extended color commands.
If that is the case it will have to be handled with conditional
compilation or a device emulation mode. We'd like to avoid that if
possible.

pcl/pccid.c


2014-04-07 19:32:45 +0200
Norbert Janssen <janssnjj@xs4all.nl>
2d0a6b70f3578a1e4ba61d05d1682a0e2a8f764b

Bug 695138: PCL pushcursor in definemacro not stored correctly (combined command)

When a macro is defined with a combined command and de define is not
the closing command (i.e. 0x) then the continuation as stored in the
macro_prefix (pcparse.c) is not correct. It contains only the <ESC>&,
but should have been <ESC>&f).
Thus a following 0S is stored as <ESC>&0S, i.s.o. <ESC>&f0S, and is not
recognized as a valid push-cursor command.

pcl/pcparse.c


2014-04-07 10:47:41 +0100
Chris Liddell <chris.liddell@artifex.com>
11bb9975a044bf281a498a8f20d3f2436725ad3d

Bug 692577: tweak lprsetup.sh for non-default locations

Provide a command line option to lprsetup.sh to specify where the filter files
should be written. Also, implement a simple heuristic to attempt to identify
the correct location for the filter files.

Finally, if we rely on the above heuristic, issue a warning and give the user
the chance to abort the script.

CLUSTER_UNTESTED

gs/lib/lprsetup.sh


2014-04-04 15:19:47 +0100
Ken Sharp <ken.sharp@artifex.com>
7e1117aa46696ea3d05f54e4bdd13d6641d53d8a

PXL font code - correct the order of a matrix multiplication

Bug #693947 "The Intellifont as type 3 font commit causes a regression."

Matrix multiplication is not commutative, and the order of operands was
incorrect in this case. Since it only matters for high level devices it
naturally only showed up with pdfwrite.

This shows a progression (with pdfwrite) in C207.bin and bug691464b.xl
which actually appears to be the same file.

pxl/pxfont.c


2014-04-04 14:42:20 +0200
Norbert Janssen <norbert.janssen@oce.com>
2024f434636139c9da20ab3afe0356d5e29c2c55

Bug 695100: pxl jpeg decoding sometimes misses scans

jpeg decoding (s_DCTD_process) is used by all pdls (pdf/ps/pcl/pxl/xps)
but in different ways.
The PDLs provide an output buffer (pw->ptr) for the decoded scan(s), and
an input buffer (pr->ptr) with inputdata. XPS's outputbuffer can contain
the complete image, the other pdls provide a buffer for 1 scan.

So XPS calls the jpeg-decoder once for the complete image (including the
EOI marker), the other pdls call repeatedly for 1 scan, until all scans
have been retrieved.

The jpeg-decoder (s_DCTD_process) calls gs_jpeg_read_scanlines(inputdata)
to decode 1 scan (using the inputdata). If inputdata is not enough the pdl
is asked for more, until (atleast) 1 scan is available. This scan
(samples) is then copied into the outputbuffer (goto dumpbuffer:).
If the outputbuffer is not filled completely, the jpeg-decoder is asked
for another scan (i.e. for XPS) which is then also added to the
outputbuffer.
Else (if the outputbuffer cannot contain the next scan) it is passed back
to the graphics-lib (pl_image_data), the outputbuffer is emptied and the
jpeg-decoder is called for the next scan.

However, with PXL, provided outputbuffer is exactly the size of a scan.
This means that it is only transferred, when s_DCTD_process wants to copy
a next scan (which fails because the outputbuffer is full; the
transferring is delayed), or end-of-data is reached.
If however, the gs_jpeg_read_scanlines() needs multiple inputbuffers to
provide this next scan, then this next scan will be copied over the not
yet transferred scan, thus causing the previous scan to be missed.

The fix in sdctd.c prevents the delaying and copies immediately.
The mod in pximage.c ensures that the complete imagedata (incl the
jpeg-EOI) is consumed (otherwise a bufferoverflow is triggered).

Some (PXL) cluster differences (progressions).

gs/base/sdctd.c
pxl/pximage.c


2014-04-02 22:57:33 +0100
Chris Liddell <chris.liddell@artifex.com>
89d0847d1f12a7069ccf2d6eff6328fd1f9aee10

Bug 695133: fix invalid types in form xobject matrix

The PDF in question has a name object rather a real or integer object as the
last entry in the matrix.

Before rendering the form, check the entries in the matrix, and if there is
an invalid type, replace it with a real value. I've opted to use 0.00 as the
replacement value, and this *seems* to reflect Acrobat's behavior. Creating
a test case where one of the scale values in the matrix is an invalid type
results in Acrobat not displaying the form, which hints at a degenerate matrix.
We have also previously established that Acrobat substitutes zero in other
similar cases.

No cluster differences.

gs/Resource/Init/pdf_draw.ps


2014-04-02 13:15:58 +0100
Ken Sharp <ken.sharp@artifex.com>
f3b31c9544c05f87fc0a58b133c5757311c49bbc

PS interpreter - don't limit sampled tint transforms to 64k data

Bug #693237 "PDF restrictions on PS function"

The bug title is misleading, as is the comment in the report. The problem
has little to do with PDF restrictions. When we get a tint transform for a
complex space we convert it into a PostScript function rather than maintaining
the tint transform as PostScript (we do this for performance reasons).

In general we try to use a type 4 (PostScript calculator) function, as these
are the most flexible variety, but these are not defined for PostScript, only
for PDF, and it is not always possible to handle a tint transform as a type
4 function. In this case we fall back to using a type 0 (sampled) function.

In order to create a sampled function we must (obviously!) sample the original
function, and create a lookup table to store the samples. This is an M-in
N-out table, so as the number of inputs and outputs increases the size of
the table increases dramatically. Because we store the data in a string
the code checks the size of the lookup table against 64k and if it is too
large (as in this case) rejects it and tries again, taking fewer samples.

The minimum number of samples is 2 (we must sample each end of the ramp),
and if we cannot fit that into a 64k string, then we returned a rangecheck
error.

However we now permit strings greater than 64k, so while we still want to
keep the lookup table to a sensible size, we should not abort just because
the table is > 64k.

This commit alters the logic so that we try to fit into a 64k string, but
if we've reached the minimum number of samples we don't bother checking any
more and simply use a string big enough to hold the data.

This seems to work, however the example file is reduced to the point where
nothing is visible on the output, and although the bug report references
a customer file its not attached to the report, nor is there any other
information which would allow me to find the original file. So this isn't
hugely well tested in this unusual condition.

No differences expected.

gs/psi/zfsample.c


2014-04-01 14:39:12 +0100
Ken Sharp <ken.sharp@artifex.com>
fb1ac66da597d9d6fe773ddaf3413098028cc6a0

pdfwrite - while processing pdfmarks, ensure strings are null-terminated before using sscanf

Bug #695119 "Ghostscript inconsistently fails creating links with pdfmark"

The problem turns out to be that while handling SrcPage in a pdfmark the
code executed sscanf on a string which was not guaranteed to be null-terminated

Here we copy the data and explicitly null terminate the copy before running
sscanf, so that the returned value is reliable.

Also remove an uninitialised variable that could potentially have caused a problem.

No differences expected.

gs/devices/vector/gdevpdfm.c


2014-03-31 20:25:27 +0100
Chris Liddell <chris.liddell@artifex.com>
5b5962e8610a279aba3841adb80d8e66bca2caa9

Bug 695087: modify jbig2 device to output jb2 files

The jbig2 device originally was written to output "bare" streams, as are written
to PDF files, but is of very limited use.

This commit changes it so the "bare" stream is written to a jb2 container file,
which can be easily opened, for example, by the jbig2dec command line tool.

Note that the output seems to be inverted, I haven't "fixed" that as I'm not
sure whether our jbi2 output is wrong, or the jbig2dec conversion to PNG is
wrong.

This is primarily to ease regression testing of the Luratech jbig2 encoder
integration.

No cluster differences.

gs/base/sjbig2_luratech.c
gs/base/sjbig2_luratech.h
gs/devices/gdevjbig2.c


2014-03-31 20:21:03 +0100
Chris Liddell <chris.liddell@artifex.com>
0ccf3294ecd3dbaa654279ca605dadccb8bd122a

Bug 695113: fix fpng device build handle shared zlib

No cluster differences.

gs/devices/devs.mak


2014-03-31 10:58:58 +0100
Ken Sharp <ken.sharp@artifex.com>
6cc95ce9fa08d126fc7c701f6eccc1cf49781e0b

ps2write - fix CompressPages=false and SubFileDecode filter

commit c30fb930e7c38dd7bcf47b0305e77cb6ba003bc3 altered the default of the
CompressPages switch to false, this uncovered an interesting bug. The code
previously used the string 'endstream' as the EODString argument for a
SubFileDecode filter. When the stream contents are compressed this is reliable
but if the stream contents are not compressed they may contain the string
'endstream' (eg a document describing PDF syntax) which would cause premature
end of data detection.

In this commit we instead set the EODString to the empty string () and set
the EODCount to the length of the stream. This is more reliable, because we
trust the stream length we create ourselves, but does mean that the stream
can no longer be edited simply, the length must now be consistent with the
actual stream contents.

This fixes a bug introdcued with commit c30fb930e7c38dd7bcf47b0305e77cb6ba003bc3
involving the test file DML_003-2010-1_8.pdf

gs/devices/vector/opdfread.h


2014-03-29 10:43:27 +0000
Ken Sharp <ken.sharp@artifex.com>
083fa3f6912ad3f44fc94d5e1a362878576b0024

ps2write - document incompatibility of ProduceDSC with the page options

gs/doc/Ps2ps2.htm


2014-03-29 10:42:57 +0000
Ken Sharp <ken.sharp@artifex.com>
c30fb930e7c38dd7bcf47b0305e77cb6ba003bc3

ps2write - alter the default of CompressPages to false for ps2write

gs/Resource/Init/gs_pdfwr.ps


2014-03-29 10:42:29 +0000
Ken Sharp <ken.sharp@artifex.com>
c126936d5bd81af58743d8770d9d21ac22e64211

ps2write - set EPS2Write to false when ProduceDSC is false

Due to the way that DSC and non-DSC headers are emitted the variable EPS2Write
wasn't set, which resulted in a PostScript error.

gs/devices/vector/gdevpdfu.c


2014-03-28 13:18:34 +0000
Ken Sharp <ken.sharp@artifex.com>
27f586bb4a5f5a3ffe6508874527eae684039380

pdfwrite - clamp CropBox to MediaBox for PDF/X output

Bug #695120 "Page boxes not nested properly when creating PDF/X using files with bleed"

The description of the bug is not accurate, the bleed is irrelevant.

The problem is caused because the specimen file has ridiculously accurate
MediaBox etc, specified to 3 decimal places. Due to rounding differences the
CropBox can be a tiny amount (thousandths of a millimeter) large than the
MediaBox.

I cannot find anywhere in the PDF/X-3 spec which says that the CropBox has
to be smaller than the MediaBox, but the Acrobat pre-flight tool complains
if it is.

This commit simply clamps the CropBox to the MediaBox that actually gets written
to the PDF file (for PDF/X only) and prevents the problem.

No differences expected

gs/devices/vector/gdevpdf.c


2014-03-27 13:13:53 +0000
Ken Sharp <ken.sharp@artifex.com>
4840334cee8f79d3dedb8b95899dc43e7a55779a

pdfwrite - don't emit ICC spaces with no Alternate and no potential default alternate

Bug #691500 "Bad pdf file generated with pdfwrite"

The XPS file cotnains a 6 colour ICC profile, the XPS interpreter passes this
along as an ICCBased space, but does not construct an /Alternate space for
it. pdfwrite would then emit a PDF file with a 6 colour profile and no
/Alternate, which is illegal as there is no possible way to convert the
input into a device space without handling the ICC profile.

If we encounter this (which I think is only possible from XPS), we now give
up on the ICC profile and instead convert to the ProcessColorModel colour
space instead.

Ghostscript can read the resulting file without error, Acrobat gives a
'drawing error' and evince complains about input profiles, but in general
I'm going to label this as a fix.

No differences expected

gs/devices/vector/gdevpdfk.c


2014-03-27 08:23:37 +0000
Ken Sharp <ken.sharp@artifex.com>
094451a13d990ba0f64c285ba157b6f45deb09e6

txtwrite - fix a buffer overrun

Bug #695109 "gswin32c produces an access violation when using txtwrite"

A cut and paste error led to us trying to copy a char string as a sequence
of shorts, resulting in overrunning the source buffer. Depending on the
precise memory layout this could cause access to unallocated memory and
an application crash.

Thanks to José Antonio for persisting with this bug and doing all the
debugging work.

No differences expected.

gs/devices/vector/gdevtxtw.c


2014-03-26 09:09:12 +0000
Chris Liddell <chris.liddell@artifex.com>
0b40e26308b5a728b1b1cbab7104c7da6b57618f

Update docs for release.

gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2014-03-26 12:52:30 +0000
Chris Liddell <chris.liddell@artifex.com>
221a37e79b9d0e93d73b257bf16fe9c96c7505a0

Bump version number.

gs/Resource/Init/gs_init.ps
gs/base/version.mak


2014-03-26 07:34:18 +0000
Chris Liddell <chris.liddell@artifex.com>
ee4458671553d95302439bacbbb66333d019b83a

Add eps2write to Linux gs and all ghostpdl bulids

No cluster differences.

gs/Makefile.in
gs/configure.ac
main/pcl6_gcc.mak
main/pcl6_msvc.mak


2014-03-26 08:46:33 +0000
Ken Sharp <ken.sharp@artifex.com>
c481ce6ab184e6cd109b856d6ba6d2bd440be85b

ps2write - better documentation for HaveTrueTypes

The documentation for HaveTrueTypes stated that TrueType fonts would be
emitted as bitmap fonts if -dHaveTrueTypes is false. This information was
only partially correct, if the size of the bitmap (as determined by the
text size and resolution) exceeds the maximum for the cache then we don't
put the bitmap in a font at all, we emit it as an inline image.

gs/doc/Ps2pdf.htm


2014-03-14 10:00:05 +0000
Chris Liddell <chris.liddell@artifex.com>
de72ef09fd37d51755faefdb4d719c78ac85d60c

doc changes from 9.12 release

Update version number, release and copyright dates.

Update release notes, changelog and couple of tweaks

Update product string and date for release.

CLUSTER_UNTESTED

gs/Makefile.in
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1
gs/psi/msvc.mak
gs/psi/winint.mak


2013-12-31 15:19:54 +0000
Robin Watts <robin.watts@artifex.com>
cdde0e961884a0dbe7e576af5f2f73df9527af6b

Import LCMS 2.6 Release version

Update gs calling code to cope, including simple mutex
handlers. Also incorporates our optimisations etc.

gs/base/gsicc_lcms2.c
gs/base/lib.mak
gs/lcms2/AUTHORS
gs/lcms2/ChangeLog
gs/lcms2/Makefile.am
gs/lcms2/Makefile.in
gs/lcms2/Projects/VC2010/testbed/testbed.vcxproj
gs/lcms2/Projects/VC2010/testbed/testbed.vcxproj.filters
gs/lcms2/Projects/VC2012/jpegicc/jpegicc.vcproj
gs/lcms2/Projects/VC2012/jpegicc/jpegicc.vcxproj
gs/lcms2/Projects/VC2012/jpegicc/jpegicc.vcxproj.filters
gs/lcms2/Projects/VC2012/lcms2.rc
gs/lcms2/Projects/VC2012/lcms2.sln
gs/lcms2/Projects/VC2012/lcms2_DLL/lcms2_DLL.vcproj
gs/lcms2/Projects/VC2012/lcms2_DLL/lcms2_DLL.vcxproj
gs/lcms2/Projects/VC2012/lcms2_DLL/lcms2_DLL.vcxproj.filters
gs/lcms2/Projects/VC2012/lcms2_static/lcms2_static.vcproj
gs/lcms2/Projects/VC2012/lcms2_static/lcms2_static.vcxproj
gs/lcms2/Projects/VC2012/lcms2_static/lcms2_static.vcxproj.filters
gs/lcms2/Projects/VC2012/linkicc/linkicc.vcproj
gs/lcms2/Projects/VC2012/linkicc/linkicc.vcxproj
gs/lcms2/Projects/VC2012/linkicc/linkicc.vcxproj.filters
gs/lcms2/Projects/VC2012/psicc/psicc.vcproj
gs/lcms2/Projects/VC2012/psicc/psicc.vcxproj
gs/lcms2/Projects/VC2012/psicc/psicc.vcxproj.filters
gs/lcms2/Projects/VC2012/resource.h
gs/lcms2/Projects/VC2012/testbed/testbed.vcproj
gs/lcms2/Projects/VC2012/testbed/testbed.vcxproj
gs/lcms2/Projects/VC2012/testbed/testbed.vcxproj.filters
gs/lcms2/Projects/VC2012/tiffdiff/tiffdiff.vcproj
gs/lcms2/Projects/VC2012/tiffdiff/tiffdiff.vcxproj
gs/lcms2/Projects/VC2012/tiffdiff/tiffdiff.vcxproj.filters
gs/lcms2/Projects/VC2012/tifficc/tifficc.vcproj
gs/lcms2/Projects/VC2012/tifficc/tifficc.vcxproj
gs/lcms2/Projects/VC2012/tifficc/tifficc.vcxproj.filters
gs/lcms2/Projects/VC2012/transicc/transicc.vcproj
gs/lcms2/Projects/VC2012/transicc/transicc.vcxproj
gs/lcms2/Projects/VC2012/transicc/transicc.vcxproj.filters
gs/lcms2/Projects/cppcheck/lcms2.cppcheck
gs/lcms2/Projects/mac/.DS_Store
gs/lcms2/Projects/mac/._.DS_Store
gs/lcms2/Projects/mac/LittleCMS/.DS_Store
gs/lcms2/Projects/mac/LittleCMS/._.DS_Store
gs/lcms2/Projects/mac/LittleCMS/Info.plist
gs/lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.mode1v3
gs/lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.pbxuser
gs/lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.pbxproj
gs/lcms2/aclocal.m4
gs/lcms2/autogen.sh
gs/lcms2/configure
gs/lcms2/configure.ac
gs/lcms2/doc/LittleCMS2.5 API.pdf
gs/lcms2/doc/LittleCMS2.5 Plugin API.pdf
gs/lcms2/doc/LittleCMS2.5 tutorial.pdf
gs/lcms2/doc/LittleCMS2.6 API.pdf
gs/lcms2/doc/LittleCMS2.6 Plugin API.pdf
gs/lcms2/doc/LittleCMS2.6 tutorial.pdf
gs/lcms2/include/Makefile.in
gs/lcms2/include/lcms2.h
gs/lcms2/include/lcms2_plugin.h
gs/lcms2/m4/acx_pthread.m4
gs/lcms2/src/Makefile.in
gs/lcms2/src/cmscam02.c
gs/lcms2/src/cmscgats.c
gs/lcms2/src/cmscnvrt.c
gs/lcms2/src/cmserr.c
gs/lcms2/src/cmsgamma.c
gs/lcms2/src/cmsgmt.c
gs/lcms2/src/cmsintrp.c
gs/lcms2/src/cmsio0.c
gs/lcms2/src/cmsio1.c
gs/lcms2/src/cmsopt.c
gs/lcms2/src/cmspack.c
gs/lcms2/src/cmsplugin.c
gs/lcms2/src/cmsps2.c
gs/lcms2/src/cmstypes.c
gs/lcms2/src/cmsvirt.c
gs/lcms2/src/cmswtpnt.c
gs/lcms2/src/cmsxform.c
gs/lcms2/src/extra_xform.h
gs/lcms2/src/lcms2.def
gs/lcms2/src/lcms2_internal.h
gs/lcms2/testbed/Makefile.am
gs/lcms2/testbed/Makefile.in
gs/lcms2/testbed/ibm-t61.icc
gs/lcms2/testbed/new.icc
gs/lcms2/testbed/testcms2.c
gs/lcms2/testbed/testcms2.h
gs/lcms2/testbed/testplugin.c
gs/lcms2/testbed/testthread.cpp
gs/lcms2/testbed/zoo_icc.c
gs/lcms2/utils/delphi/lcms2dll.pas
gs/lcms2/utils/jpgicc/Makefile.in
gs/lcms2/utils/jpgicc/jpgicc.c
gs/lcms2/utils/linkicc/Makefile.in
gs/lcms2/utils/psicc/Makefile.in
gs/lcms2/utils/psicc/psicc.c
gs/lcms2/utils/tificc/Makefile.in
gs/lcms2/utils/tificc/tificc.c
gs/lcms2/utils/transicc/Makefile.in
gs/lcms2/utils/transicc/transicc.1


2014-03-24 10:00:23 +0000
Ken Sharp <ken.sharp@artifex.com>
c74e146b74fe6db9f3a91ff71b7478dac79b5c1a

Repair performance degradation with PostScript functions

Bug #693561 "gs_c_param_list_release() corrupts memory"

The commit 289aa28f46e2be1c87c34d44ee86dec41e87506b removed the explicit
test of the device name with a test against a specifically named device
parameter. However, as noted in the bug, this led to a performance penalty
as the parameter was re-evaluated inside a loop.

This commit moves the parameter evaluation outside check_psc_function()
altogether as this routine can be called recursively. Instead the parameter
is retrieved in the calling routines and passed as a new argument.

No differences expected

gs/psi/zfunc4.c


2014-03-24 09:56:32 +0000
Ken Sharp <ken.sharp@artifex.com>
23666d2037f14a1ef880e60bce9008203e502436

Make C 'param' collections free memory as per 'ref' params

Bug #693561

The 'memory corruption' referred to in the bug report is actually a memory
leak, and is only exposed by using the -Z? (check pointers) debugging switch.
As such its not as disastrous as the bug report makes it sound (I'm unable
to reproduce the SEGV).

Its caused because when we retrieve a parameter list from the device, we do
so using the 'C' param list structures rather than the PostScript 'ref'
params. One of the things that pdfwrite returns is image dictionaries, and
these require us to create a temporary param list. With the 'ref' param
structures, when we call param_end_write_dict (redirected through a macro
to param_end_write_collection, further redirected through a macro to
plist->procs->end_xmit_collection) the memory used by the list is explicitly
freed, when we use the 'C' param, it is *NOT* freed.

All the places in the code that I can find where we call param_end_write_dict
seem to assume that this will also free the memory. This commit modifies
the C param list code so that it also frees the memory. At least now the
two param types behave the same.

No differences expected

gs/base/gscparam.c


2014-03-22 04:07:14 +0000
Hin-Tak Leung <hintak@ghostscript.com>
8ae4ee220766aa180150eafeffe4f094f1354f92

Fixes PXL segfault with trying to set up icc transform for bitmasks, Bug 695103

Masks also get treated as images (the conditionals about being masks,
bit-depths, interpolation, etc is getting really long...), and the
iccTranform change mistakenly try to set up link transform for such.
There should be an additional conditional (where this change is) for
the data not being masks. This is equivalent to not
setting up icc tranform for missing color space info (Part 1), but clearer.
The other two check images having valid color space info, and should stay.

Cluster tested. No difference expected.

Signed-off-by: Hin-Tak Leung <hintak@ghostscript.com>

gs/devices/vector/gdevpx.c


2014-03-21 21:44:30 +0000
Hin-Tak Leung <hintak@ghostscript.com>
553cea8ecaeba7a48837325da098583eaef5f1ca

Further protection against PXL segfault with image data without colorspace info, Bug 695103

Someghow since gs 9.10, it becomes possible for image data to arrive
without colorspace info, and accessing such causes segfault; we should
protect against it in any case, but further investigation (possibly
by somebody else) is needed on how that happened. Part 2 of the fix.

Cluster tested. No difference expected.

Signed-off-by: Hin-Tak Leung <hintak@ghostscript.com>

gs/devices/vector/gdevpx.c


2014-03-21 21:42:30 +0000
Hin-Tak Leung <hintak@ghostscript.com>
b780ff05fd1959202b27f9c0da383968a7e398e9

Protection against PXL segfault with image data without colorspace info, Bug 695103

Someghow since gs 9.10, it becomes possible for image data to arrive
without colorspace info, and accessing such causes segfault; we should
protect against it in any case, but further investigation (possibly
by somebody else) is needed on how that happened. Part 1 of the fix.

Cluster tested. No difference expected.

Signed-off-by: Hin-Tak Leung <hintak@ghostscript.com>

gs/devices/vector/gdevpx.c


2014-03-20 11:40:18 +0000
Ken Sharp <ken.sharp@artifex.com>
b504d2f72c6903a4dbf66176ec3358e4cd5d151d

pdfwrite - fix multi-plane images with < 8bpc

The code to pack multiple bit planes into bytes didn't properly account
for the number of bytes to be written to the output. We always wrote a
full block of bytes as long as the number of bytes remaining was not
greater than our block size. That is, it did not account for the fact that
we might not need to write a complete block of bytes, in the case where the
number of bytes left was exactly equal to the size of our internal block.

Fixed that by changing the '>=' to '>' so that if the size was equal we would
properly check to see how many bytes we actually need to write. This then
uncovered another problem, if the width of the image in bits was a multiple
of the block size, then we wouldn't write any data. Fixed that too.

No differences expected.

gs/devices/vector/gdevpdfi.c


2014-02-14 23:18:53 +0000
Hin-Tak Leung <hintak@ghostscript.com>
bccf1cdd8d8936a8ff89ea09c1887a4816ca5685

Miscellaneous corrections to typos and comments, accumulated over a while.

Not cluster tested.

Signed-off-by: Hin-Tak Leung <hintak@ghostscript.com>

gs/base/gxblend.h
pcl/pcindxed.c
pcl/rtgmode.c
pcl/rtraster.c


2014-03-10 00:37:09 +0000
Hin-Tak Leung <hintak@ghostscript.com>
d1f1b3eccb689bb9c1fa80f20f222c44ed563e99

Fixes unicode-processing related slowdown from the python 2 to 3 migration.

Replaces the last "+" usage by join() in the hex dump part.

Concatenation via "+" in python has always known to be slow.
It becomes of acceptable speed towards the end of the python
2 cycle, and becomes very slow again when 3-migration
compatibility for python 2 is switched on. This is a
Python string processing idiosyncrasy - the optimal
ways of concatenating strings in python is via join(), instead
of the more common "+".

3MB test file (attachment 9725 to bug 694086) - any
non-small PXL file should do. "+" is almost 20x slower
than join():

$ time python2 before/pxldis.py test.pxl > /dev/null

real 4m39.810s
user 4m9.798s
sys 0m2.548s

$ time python3 before/pxldis.py test.pxl > /dev/null

real 0m13.150s
user 0m12.374s
sys 0m0.081s

$ time python2 after/pxldis.py test.pxl > /dev/null

real 0m18.653s
user 0m17.871s
sys 0m0.129s

$ time python3 after/pxldis.py test.pxl > /dev/null

real 0m13.295s
user 0m12.969s
sys 0m0.053s

Not cluster tested. cluster testing is not relevant to this script.

Signed-off-by: Hin-Tak Leung <hintak@ghostscript.com>

tools/pxldis.py


2014-03-12 15:16:05 +0000
Hin-Tak Leung <hintak@ghostscript.com>
41ab485d48890ecadc3d5f74657b644f9d1a8d7f

pxlmono/pxlcolor: Transform deep (24-bit) images with an ICC transform to emit high-level images. Bug 690867.

Deep images with an associated rendering intent
or custom colour spaces, or icc profiles, could be emitted
more efficiently as high-level PXL images if the individual
pixels values are transformed through the icclink transform.

The new code path is off by default, and switched on via an option
(-diccTransform). When the new code is thoroughly tested, this
option will be removed and the new code path will become the default.

Cluster tesed - new code is optional and off by default,
no difference is expected.

Signed-off-by: Hin-Tak Leung <hintak@ghostscript.com>

gs/devices/vector/gdevpx.c


2014-03-12 15:03:58 +0000
Hin-Tak Leung <hintak@ghostscript.com>
4b44b41c9b6c4a7e5ebf03b6970f9be39548443b

Implements PCL XL Compression Mode 2 (JPEG), and updated documentation and other support files. Bug 694282.

This patch implements PCL XL Compression Mode 2 (JPEG) -
Bug 694282. Compression Mode 2 would be appropriate when the
original image data is already lossy (Bug 691880 - JPX,
Bug 690867 - JPEG).

Unlike compression mode 1 (RLE) and 3 (DeltaRow), JPEG
is not appropriate for arbitrary indexed-coloured images
or masks, so this new functionality will silently fall
back to RLE for masks and other unsuitable data.
Currently it is limited to apply to only 24-bit input to
be on the conservative side. Further furture improvement
may be possible for gray 8-bit images to emit gray jpeg
if those can be identified accurately.

Cluster tested. The new functionality is optonal and controlled by
-dCompressMode=2 (default 1) so no difference is expected.

Signed-off-by: Hin-Tak Leung <hintak@ghostscript.com>

gs/devices/devs.mak
gs/devices/vector/gdevpx.c
gs/doc/Devices.htm


2014-03-18 11:41:44 -0700
Ray Johnston <ray.johnston@artifex.com>
39da69e074c36e5a56ac52041444e4af1aa9a7c8

Fix Segfaults caused by 'vertical stripe' fix (f18fac0).

The done flag is no longer needed and caused us to exit the while
loop before processing enough of the data.

Also, move_landscape_buffer could end up with position_curr ==
position_new so we were moving 'in place' (wasting time). Fix that.

gs/base/gxht_thresh.c


2014-03-18 11:39:51 +0000
Ken Sharp <ken.sharp@artifex.com>
7c8b652e6e9019c8e9c9731f8e7a59c3505db638

pdfwrite - null a pointer to avoid an enumeration problem

pdev->vgstack wasn't being set to NULL when freed, which could lead to
garbage collection problems.

At the same time, remove two macros which I really don't like (and made this
problem difficult to locate) and set a couple more pointers to NULL when
the contents are freed.

Bug #694380, but unfortunately this simply causes a seg fault in a different
location.

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfx.h
gs/devices/vector/gdevpdtd.c


2014-03-18 10:44:49 +0000
Chris Liddell <chris.liddell@artifex.com>
f20811cce805fcc748e58112ec4fdaa87b934960

Bug 694612: add some bounds checking to fax decode

to prevent writing off the end of the buffer with corrupted data.

No cluster differences.

gs/base/scfd.c


2014-03-17 13:07:37 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2ab7e7b2d8a7cf92b3cb5c4e6d4455e4badc98de

Fix to turn of BPC when we are using the Gray_to_K ICC profile.

This appears to be a bug in lcms. Will follow up with Marti. Also fix for tiff64nc. In the test
tiff_compression_allowed we were missing the test for the 16 bit case. Surprisingly this commit
results in progressions in the 8 bit device outputs too when we have a gray source and going
to a CMYK device.

gs/base/gsicc_cache.c
gs/devices/gdevtifs.c


2014-03-17 13:06:05 +0000
Ken Sharp <ken.sharp@artifex.com>
5412d27994c9abec041e798592b2c842d8910a5c

pdfwrite - handle CIDFonts with mixed type 3/type 1 descendants

Bug #691096 "the file generated by ps2pdf from this PS file does not display some chars"

The input has a CIDFont declared which uses both a type 1 and a type 3 font
as descendants. The pdfwrite device family can't handle this, resulting in
/.notdef glyphs.

In this commit; when we detect a switch to a type 3 descendant, and the previous
font was not a type 3, we set 'type3charpath' to true. This forces the
text handling to fall back to a bitmap font mode for this text.

This is less than ideal, but its a very rare occurence and does result in
all the text being rendered.

No differences expected

gs/devices/vector/gdevpdtc.c


2014-03-15 12:47:22 -0700
Ray Johnston <ray.johnston@artifex.com>
4f18e30f56b7fcc339b617e82e948ed96d561cde

Git rid of some simple 'unused' compiler warnings.

gs/base/gsfcmap1.c
gs/base/gsicc.c
gs/base/gsicc_create.c
gs/base/gxdcolor.c
gs/base/gxht_thresh.c
gs/base/gxp1fill.c
gs/base/gxshade.c


2014-03-14 14:39:51 -0700
Ray Johnston <ray.johnston@artifex.com>
1e79e7e3f12404a85d52dfa28b254998b39b0782

Fix broken detection for fast image threshold, planar and GrayValues > 2.

The detection enabled ALL planar devices, so bits per component 2 and
above would use the 1 bit methods.

gs/base/gxicolor.c


2014-03-14 09:44:08 +0000
Chris Liddell <chris.liddell@artifex.com>
bb78de3c11b86088126d3f5d2a7a4c817caf4935

Bump version numbers.

gs/Resource/Init/gs_init.ps
gs/base/version.mak


2014-03-13 20:35:53 -0700
Ray Johnston <ray.johnston@artifex.com>
f18fac03991c6164dfad81f03b3e7a8a4eadf243

Fix sporadic vertical stripes with planar fast image thresholding (pkmraw)

In the landscape code, only the data for the last plane was being moved
to the start of the contone data for the next 32 lines of output. Seen
with -sDEVICE=pkmraw -dUsePlanarBuffer J8_landscape.ps but any landscape
image could have the problem. New code moves all planes and only resets
the ht_landscape parameters after all planes have been processed and
output (via copy_planes).

gs/base/gxht_thresh.c


2014-03-26 09:09:12 +0000
Chris Liddell <chris.liddell@artifex.com>
a76558de66281375e2a738a2380ca62c0fd223d4

Update docs for release.

gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2014-03-26 09:06:56 +0000
Chris Liddell <chris.liddell@artifex.com>
3ab7b7c314bf478ad76dae0f90f2dd6370fa11a6

Up version number

gs/Resource/Init/gs_init.ps
gs/base/version.mak


2014-03-26 07:34:18 +0000
Chris Liddell <chris.liddell@artifex.com>
0e3e14fce68beb871c48e427af6904f7441bf803

Add eps2write to Linux gs and all ghostpdl bulids

No cluster differences.

gs/Makefile.in
gs/configure.ac
main/pcl6_gcc.mak
main/pcl6_msvc.mak


2014-03-25 08:39:14 +0000
Chris Liddell <chris.liddell@artifex.com>
3059462485a66539f8a036b1bc60584f74901ac2

Update product string and date for release.

gs/base/gscdef.c
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2014-03-14 11:56:29 +0000
Chris Liddell <chris.liddell@artifex.com>
aac778af6233ee10e66c1ca3f902adf8b6566b60

Update release notes, changelog and couple of tweaks

gs/doc/History9.htm
gs/doc/News.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Use.htm


2014-03-18 11:41:44 -0700
Ray Johnston <ray.johnston@artifex.com>
20f8aebb83a88ca225b67c3bbf5e6dae936349b0

Fix Segfaults caused by 'vertical stripe' fix (f18fac0).

The done flag is no longer needed and caused us to exit the while
loop before processing enough of the data.

Also, move_landscape_buffer could end up with position_curr ==
position_new so we were moving 'in place' (wasting time). Fix that.

gs/base/gxht_thresh.c


2014-03-17 13:07:37 -0700
Michael Vrhel <michael.vrhel@artifex.com>
7458c4b5eed25b49ba15dcb37b6dd2ec1d6f0089

Fix to turn of BPC when we are using the Gray_to_K ICC profile.

This appears to be a bug in lcms. Will follow up with Marti. Also fix for tiff64nc. In the test
tiff_compression_allowed we were missing the test for the 16 bit case. Surprisingly this commit
results in progressions in the 8 bit device outputs too when we have a gray source and going
to a CMYK device.

gs/base/gsicc_cache.c
gs/devices/gdevtifs.c


2014-03-13 20:35:53 -0700
Ray Johnston <ray.johnston@artifex.com>
c23cde8b44a751a787636a7747b42b2da7911922

Fix sporadic vertical stripes with planar fast image thresholding (pkmraw)

In the landscape code, only the data for the last plane was being moved
to the start of the contone data for the next 32 lines of output. Seen
with -sDEVICE=pkmraw -dUsePlanarBuffer J8_landscape.ps but any landscape
image could have the problem. New code moves all planes and only resets
the ht_landscape parameters after all planes have been processed and
output (via copy_planes).

gs/base/gxht_thresh.c


2014-03-14 10:00:05 +0000
Chris Liddell <chris.liddell@artifex.com>
b65f4e9d7cdd32981680a5486e1c1c320ac4046e

Update version number, release and copyright dates.

gs/Makefile.in
gs/Resource/Init/gs_init.ps
gs/base/gscdef.c
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1
gs/psi/msvc.mak
gs/psi/winint.mak



Version 9.14 (2014-03-26)

This is the tenth full release in the stable 9.x series, and is primarily a maintenance release.

Highlights in this release include:

For a list of open issues, or to report problems, please visit bugs.ghostscript.com.

Incompatible changes

No recorded incompatible changes.

Changelog

2014-03-14 10:00:05 +0000
Chris Liddell <chris.liddell@artifex.com>
b65f4e9d7cdd32981680a5486e1c1c320ac4046e

Update version number, release and copyright dates.

gs/Makefile.in
gs/Resource/Init/gs_init.ps
gs/base/gscdef.c
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/SavedPages.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1
gs/psi/msvc.mak
gs/psi/winint.mak


2014-03-18 11:41:44 -0700
Ray Johnston <ray.johnston@artifex.com>
20f8aebb83a88ca225b67c3bbf5e6dae936349b0

Fix Segfaults caused by 'vertical stripe' fix (f18fac0).

The done flag is no longer needed and caused us to exit the while
loop before processing enough of the data.

Also, move_landscape_buffer could end up with position_curr ==
position_new so we were moving 'in place' (wasting time). Fix that.

gs/base/gxht_thresh.c


2014-03-17 13:07:37 -0700
Michael Vrhel <michael.vrhel@artifex.com>
7458c4b5eed25b49ba15dcb37b6dd2ec1d6f0089

Fix to turn of BPC when we are using the Gray_to_K ICC profile.

This appears to be a bug in lcms. Will follow up with Marti. Also fix for tiff64nc. In the test
tiff_compression_allowed we were missing the test for the 16 bit case. Surprisingly this commit
results in progressions in the 8 bit device outputs too when we have a gray source and going
to a CMYK device.

gs/base/gsicc_cache.c
gs/devices/gdevtifs.c


2014-03-13 20:35:53 -0700
Ray Johnston <ray.johnston@artifex.com>
c23cde8b44a751a787636a7747b42b2da7911922

Fix sporadic vertical stripes with planar fast image thresholding (pkmraw)

In the landscape code, only the data for the last plane was being moved
to the start of the contone data for the next 32 lines of output. Seen
with -sDEVICE=pkmraw -dUsePlanarBuffer J8_landscape.ps but any landscape
image could have the problem. New code moves all planes and only resets
the ht_landscape parameters after all planes have been processed and
output (via copy_planes).

gs/base/gxht_thresh.c


2014-03-14 09:40:22 +0000
Chris Liddell <chris.liddell@artifex.com>
7784cce96478d8bcec314e2dc8ecb3d3a849c37b

Add missing newline to memento error logging.

CLUSTER_UNTESTED

gs/base/memento.c


2014-03-11 08:31:32 -0700
Ray Johnston <ray.johnston@artifex.com>
c34097f6786f809826a30484e69684adf4915e9a

Fix output color values of pkm and pkmraw for GrayValues > 2.

In the header we indicate the max value is 255, so the output values
need to be scaled to that, not the color_info.max_color. We stay with
255 since many viewers cannot display PPM files with other that 255
as the max (ignoring the max value in the header).

gs/devices/gdevpbm.c


2014-03-13 11:43:24 +0000
James Cloos <cloos@jhcloos.com>
685e801f7de04d087166e24b3373ab16dcca57bc

Bug 695080: fix typo in the pngmono device declaration

which caused pngmono to threshold rather than halftone at or above 150 dpi.

No cluster differences.

gs/devices/gdevpng.c


2014-03-13 13:47:56 +0000
Robin Watts <robin.watts@artifex.com>
303b48577602fb78df5fa40eb2de1d8e73245afa

Bug 695090: Solve memory overwrite with pkmraw in planar mode.

When using -dUsePlanarBuffer with the pnm devices, we run the
underlying rendering in planar mode, but then expect 'getbits'
to return chunky pixels. As such, the memory we allocate to
'getbits' into should be allocated for chunky mode, not for
planar mode.

gs/base/gdevprn.h
gs/base/gsdevice.c
gs/base/gxdevcli.h
gs/devices/gdevpbm.c


2014-03-13 11:19:11 +0000
Chris Liddell <chris.liddell@artifex.com>
f2fde5b9596318796f4ffd8d356116b1bb203ae3

Delete gs_fform.ps

If we want to cache forms, we should implement it properly.

CLUSTER_UNTESTED

gs/lib/gs_fform.ps


2014-03-13 10:53:49 +0000
Andreas Schwab <schwab@linux-m68k.org>
becedfbfdbd9dee77825ff245f48c0acc9d03252

Bug 695058: force correct struct ref_s size

On compilers that tightly pack structures (i.e. don't pad to alignment
boundaries), struct ref_s could end up as 14 bytes instead of 16 bytes,
thus breaking requirement in the garbage collector.

This is less than ideal, and would be better achieved using the same trick
we use for the alignment of obj_header_s in base/gxobj.h, linking the structure
size to the obj_align_mod, but as on the majority of systems struct ref_s is
already 16 bytes, that results in a zero byte array which notable compilers (at
least MSVC, and probably others) to error.

No cluster differences,

gs/psi/iref.h


2014-03-13 09:27:28 +0000
Chris Liddell <chris.liddell@artifex.com>
fdaa74efeebb753db1855eaf6a3a824ecbf1231e

Remove deprecated glyph mapping code.

No cluster differences.

gs/Resource/Init/gs_ttf.ps
gs/Resource/Init/gs_type1.ps


2014-03-12 17:18:25 +0000
Chris Liddell <chris.liddell@artifex.com>
fe0b8fcfb69246cbea99b85f453ed6c3c83f4592

Bug 693380: raise file path/name size limit to 4k

And move as many cases of paths allocated on the stack to heap memory as is
reasonable.

No cluster differences.

gs/base/gdevdevn.c
gs/base/gp.h
gs/base/gsdevice.c
gs/base/gsiodisk.c
gs/base/gsiomacres.c
gs/base/gsparam2.c
gs/devices/gdevtsep.c
gs/devices/vector/gdevxps.c
gs/psi/zfile.c
xps/xpsjxr.c


2014-03-13 10:35:33 +0000
Ken Sharp <ken.sharp@artifex.com>
83b6646951fee8fe153d14d3e2d7da75894b922a

PDF interpreter - fix multiple xref stream reading

Bug #695086 "**** Error: Trailer is not found."

When reading Xref streams, the PDF interpreter resizes its internal xref
tracking objects by looking at the /Size of the stream and making sure
the objects are at least that big. However it did not account for the fact
that an Xref stream may not start with object 0.

In this case the first stream encountered had a /Size of 2, and an /Index
of [6 0]. This meant that we allocated objects of size 2, then tried to store
into location8, which naturally failed.

This commit adds the /Index (starting object number) to the /Size before
ensuring the objects are large enough.

No differences expected

gs/Resource/Init/pdf_main.ps


2014-03-12 21:25:39 -0700
Marcos H. Woehrmann <marcos@inches.(none)>
fadf80da45458db57cffdd90f1ed6c57aa31e51f

Fixed typo in Devices.htm.

gs/doc/Devices.htm


2014-03-12 15:52:34 +0000
Ken Sharp <ken.sharp@artifex.com>
94d070553225e0a8fb38157e081e9496dee8fde5

pdfwrite - remove deprecated code

Before the release of 9.06 I #ifdef'ed a load of code as deprecated. Nobody
has found any problems, so I'm removing the code.

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfp.c
gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpdfx.h
gs/devices/vector/gdevpdt.h
gs/devices/vector/gdevpdte.c
gs/devices/vector/gdevpdtf.h
gs/devices/vector/gdevpdtt.c
gs/devices/vector/gdevpdtw.c
gs/devices/vector/gdevpsds.c


2014-03-12 13:32:05 +0000
Ken Sharp <ken.sharp@artifex.com>
0598a205e9293fcaf548571624d93f534afa098d

Documentation - remove %ram% from the projects, as it is completed

gs/doc/Projects.htm


2014-03-12 09:33:24 +0000
Ken Sharp <ken.sharp@artifex.com>
8fad68f7c27f16cf78967443322bc4f638649f27

Update documentation for the pdfwrite family

devices.htm - change epswrite references to eps2write, note that support for
language level 1 output is now removed.

drivers.htm - alter pswrite to ps2write

use.htm - alter epswrite to eps2write

issues.htm - remove a surprisingly large number of documented issues which
appear to be no longer issues. Note that epswrite is deprecated.

ps2pdf.htm - improve the documentation of PDF/A and PDF/X output and correct
the places where it was incorrect with the new colour management.

No differences.

gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Issues.htm
gs/doc/Ps2pdf.htm
gs/doc/Use.htm


2014-03-11 09:58:31 -0600
Henry Stiles <henry.stiles@artifex.com>
ee30f349671e3a23d666615f1648eab4a5290b4c

Abbreviated escape sequence improvement.

Abbreviated escape sequences were not handled properly with commands
that hold arbitrary amounts of data, like raster and font related
commands. PCL shorthand is rarely used in this circumstance
but it is legal. Thanks to Hin-Tak for the discovery and analysis of
this problem.

pcl/pcparse.c
pcl/pcparse.h


2014-03-09 16:11:24 +0000
Chris Liddell <chris.liddell@artifex.com>
4c2f426905b4bf300f6b412024d71cd2be6276de

Remove GhostSVG.

No cluster differences.

Makefile
gs/configure.ac
svg/ghostsvg.h
svg/svg.mak
svg/svg_gcc.mak
svg/svg_msvc.mak
svg/svgcolor.c
svg/svgcolorlist.h
svg/svgdoc.c
svg/svgshapes.c
svg/svgtop.c
svg/svgtransform.c
svg/svgtypes.c
svg/svgxml.c


2014-03-09 15:54:06 +0000
Chris Liddell <chris.liddell@artifex.com>
8dacc34a50174bceac7786ce47466d9a71547955

Remove SVG writer from Ghostscript/GhostPDL

No cluster differences.

gs/Makefile.in
gs/configure.ac
gs/devices/devs.mak
gs/devices/vector/gdevsvg.c
gs/psi/msvc.mak


2014-03-06 11:57:00 -0800
Ray Johnston <ray.johnston@artifex.com>
22ebcc33db33aa15399a6836e48953736256eb41

Fix UseFastColor during clist playback.

Discovered with customer 532, the default_match was not set early
enough in gsicc_get_link for the index to be correct, effectively
disabling usefastcolor mode. As a result images could be rendered
with ICC based color transform instead of the 'nocm' fastcolor
methods.

gs/base/gxclimag.c
gs/base/gxclist.h
gs/base/gxclrast.c


2014-03-08 20:29:30 +0000
Chris Liddell <chris.liddell@artifex.com>
f5457548e8162438a43b1aeb2040e34c001adaa4

Use malloc/free for lcms(2) shared lib build.

No cluster differences.

gs/base/gsicc_lcms.c
gs/base/gsicc_lcms2.c
gs/base/lcms.mak
gs/base/lcms2.mak


2014-03-07 17:00:28 +0000
Ken Sharp <ken.sharp@artifex.com>
58121374ed0d12aa38c872eb4d069b75ed5875d5

cast to silence a compiler warning

gs/base/gdevvec.c


2014-03-07 13:41:01 +0000
Ken Sharp <ken.sharp@artifex.com>
94c5ecffe4bf66cc91108d99a802c7c2d3b86e0b

PS interpreter, vector devices and pdfwrite - remove setdash limit of 11

Bug #693916 "setdash does not accept more than 11 elements in the array argument"

The PostScript interpreter was already capable of this, it simply required
the limit check to be removed. The vector device needed to allocate and
free an array of floats, rather than maintain a fixed size array.

pdfwrite was teh most complex as it maintains a stack of gstates, and these
also needed to be modified to allocate and free the dash array. However the
gstate stack wasn't already a garbage collecting structure. Rather than going
to the effort of turning it into one I've opted to allocate the dash pattern
from non-gc memory.

A few PCL files show differences with pdfwrite, because previously pdfwrite
would throw an error (more than 11 elements in the dash array) and the stroked
lines would degenerate into filled rectangles, whereas now they are drawn as
stroked lines with a correct dash pattern. This is much more efficient.

The clist remains unmodified, Ray assures me that it will be handled there
without problems.

gs/Resource/Init/gs_init.ps
gs/base/gdevvec.c
gs/base/gdevvec.h
gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfx.h


2014-03-05 09:47:52 -0800
Ray Johnston <ray.johnston@artifex.com>
4b16c45c3b834efb9ff9608360d3c053e91b1f23

Fix UseFastColor ignored for pages with transparency.

Found when researching problem from customer 532.

gs/base/gdevp14.c


2014-03-03 12:21:12 -0800
Ray Johnston <ray.johnston@artifex.com>
e63f9d066c001052f5594f09c3a3a59ff80d2d03

Fix problem with -d***Values=16 and bitrgb device.

The max_gray and max_color would confuse the gx_device_must_halftone
macro because setting -dGrayValues=16 would end up setting the
max_gray and max_color to 31 (0x1f) which does NOT halftone. with
the change setting to 16 values doesn't change the bpc if put_params
is called again. Also remove allowing -dGrayValues=32 from supported
choices.

gs/devices/gdevbit.c


2014-03-05 08:54:56 +0000
Ken Sharp <ken.sharp@artifex.com>
b442d9a0c193d2d0114e72e1312e7bcc6e558aab

pdfwrite revert 3894e9c8a3ab125c82048da3bf81515500bb2da0


Bug #695083 " Regression: pdfwrite DEVICE generates extra page with -dLastPage= option"
This wasn't a customer bug report, and it doesn't work well with PCL, when
specifying -dLastPage, so I've decided just to revert it.

A very few PCL files are flagged by the cluster as different, but there are
no bmpcmp diffs.

gs/devices/vector/gdevpdf.c


2014-03-03 17:34:08 +0000
Robin Watts <robin.watts@artifex.com>
9a68412d171e5c998026a13dffcbc90ef9d477b9

Bug 695007: Fix problems with unicode chars in TEMP path.

If there are unicode chars in the temporary path (either that
given by TMPDIR, TEMP or windows own GetTempPath functions)
when opening a scratch file, we mishandle them.

This commit improves the behaviour to treat paths consistently
as UTF8.

This incorporates changes from Paul Gardiner to make the winrtsup.cpp
functions use wide chars. This simplifies the functions and integrates
better with the calling code. Also fix some uses of sizeof where size
in chars was required.

gs/base/gp_mswin.c
gs/base/winrtsup.cpp
gs/base/winrtsup.h


2014-03-04 10:24:47 +0000
Paul Gardiner <paulg-artifex@glidos.net>
f29e49d4b157a84b4793eda614447811b471c047

Fix pointer-usage bug in GetTempFileNameWRT

gs/base/winrtsup.cpp


2014-03-04 15:30:02 +0000
Ken Sharp <ken.sharp@artifex.com>
5b2adda7468241123d9559a98cd469f527dd7e3c

pdfwrite - do not apply the 'Default*' colour spaces

Noticed while testing by Chris.

The PDF spec says that if any of DefaultGray, DefaultRGB or DefaultCMYK are
present in a PDF page, then we should use those to do a conversion to
device-independent colour space for colours specified in the matching Device*
space.

This is broadly equivalent to the UseCIEColor PostScript user parameter but
unlike that parameter the user has no control over it. Previously we applied
this conversion but it seems unreasonable to do this for pdfwrite as this
will convert a PDF using device spaces into a PDF using ICCBased spaces.

Accordingly we now test the device properties and for HigLevel devices we
do *not* perform this conversion.

If the conversion really is desired then setting -dUseCIEColor will perform it.

This results in a very few files showing differences, neither progressions
nor regressions, merely different. However the pdfwrite warning about use
of UseCIEColor does go away.

gs/Resource/Init/pdf_main.ps


2014-03-04 09:25:18 +0000
Chris Liddell <chris.liddell@artifex.com>
2621110f37eb0c94a732578acd24634caec1c25b

Bug 694832: add an explicit flag for TTF notdef

The previous solution for this issue "overloaded" an existing workaround for
pdfwrite. Unfortunately, a clash between pdfwrite's needs and FAPI's meant it
did not work all the time.

So, when loading a TTF for use in a PDF, add a new flag to the font dictionary
to tell the FAPI code whether to render a Truetype notdef.

Several differences show up on the cluster - the following are progressions
compared to Acrobat:
Bug689757.pdf
Bug691031.pdf
Bug691221.pdf
Bug693538.pdf
Bug693646.ps
Bug693711.pdf
keyboard.pdf
CATX1490.pdf
IA3Z0815.pdf

These are different from before, but since Acrobat can't even open these,
I don't much care:
207ee6f24411fc4591d2b5a337c46de8-full.pdf
2123_-_MacExpertEncoding_badly_handled.pdf
764_-_heading_garbage.pdf

gs/Resource/Init/gs_ttf.ps
gs/psi/zfapi.c


2014-03-04 09:49:52 +0000
Ken Sharp <ken.sharp@artifex.com>
0214c1b9c70cd41026e5cda707e582b32489a64c

remove a misleading comment

gs/devices/vector/gdevpdfu.c


2014-03-04 09:47:50 +0000
Ken Sharp <ken.sharp@artifex.com>
095ae57e266ee5168f042c26dd2e9d12273efb28

ps2write - fix missing %%BeginResource comment for FontFile objects

Bug #695082 " ps2write: Some "%%BeginResource" DSC comments have only one "%" character"

FontFile streams were being written with a "%%EndResource" comment, but the
"%%BeginResource" comment was missing.

No differences expected

gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpdfx.h
gs/devices/vector/gdevpdtd.c


2014-03-03 14:14:19 +0000
Ken Sharp <ken.sharp@artifex.com>
649848310dd4f9400f63c685748e4f76344ba9d7

ps2write - fix a DSC comment

Bug #695082 "ps2write: Some "%%BeginResource" DSC comments have only one "%" character"

A DSC comment was emitted using a printf format string without escaping the
"%"s

No differences expected.

gs/devices/vector/gdevpdtd.c


2014-02-27 11:28:57 +0000
Ken Sharp <ken.sharp@artifex.com>
f6abeac1c7ab3ee82523353b5373230e2607c0b9

pdfwrite - fix commit 1d1d22976ce5b5e96d862c404ca80f189476bfed

Despite not throwing any regressions, there was a bug in this commit.

A couple of places used the pprintld* routines, which *don't* accept the
%"PRId64" sequence and this led ot us writing an invalid xref.

Fixed here by using gs_sprintf instead.

gs/devices/vector/gdevpdf.c


2014-02-27 09:33:13 +0000
Ken Sharp <ken.sharp@artifex.com>
1d1d22976ce5b5e96d862c404ca80f189476bfed

pdfwrite - fix FastWebView for big-endian devices

Bug #695075 " Creating "optimized" PDF on Big-endian OS gives errors when view the PDF indicating PDF is not right"

This commit applies all the changes supplied by Jonathan Dagresta of SDL,
see the bug report for details.

No differences expected.

gs/devices/vector/gdevpdf.c


2014-02-26 10:38:02 -0800
Ray Johnston <ray.johnston@artifex.com>
30f2c656469f5930b1adc82454706743df68b0d7

Disable threshold array based image optimization for depth > 1.

The monochrome image case in gximono.c already checked for depth == 1
but the gxicolor.c code was missing this. These can be removed when
the gxht_thresh.c code is enhanced for greater bit depths.

gs/base/gxicolor.c


2014-02-26 09:20:37 +0000
Ken Sharp <ken.sharp@artifex.com>
b53c81e38925d05b00ba9068aebc5fcbc519a685

ps2write - add a feature to customise the output for specific devices

Bug #695070 "Customer would like a way to specify printer specific features in ps2write device"

This commit adds two new distiller params, specific to ps2write, PSDocOptions
and PSPageOptions, which are described in detail in the ps2ps2.htm document.

These allow an end user to specify PostScript (normally device-specific
configuration) which can be injected into a DSC compliant file at the documet
level and at the individual page level.

No differences expected

gs/Resource/Init/gs_pdfwr.ps
gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpsdf.h
gs/devices/vector/gdevpsdp.c
gs/doc/Ps2ps2.htm


2014-02-23 09:46:21 -0800
Ray Johnston <ray.johnston@artifex.com>
77fce4a0cfd70b94a90a876cac0310fda1a969ee

Fix bug 695054, segfault caused by stale pointer in pattern-clist device.

The pattern-clist device could be left allocated in stable memory
after the pattern was removed from the pattern cache. The pattern
instance could be freed by a subsequent restore since it was not
in stable memory. GC trace of the chunks would then reference the
stale pinst pointer. Also, the heap pointer needs to be valid in
ialloc_validate_spaces 'state' since it can be used for error output
and this could cause a segfault.

gs/base/gxpcmap.c
gs/psi/ilocate.c


2014-02-24 10:41:23 -0700
Henry Stiles <henry.stiles@artifex.com>
9990bdac31c018de33de2c09053b7e392a26304f

Fix Bug 694685 - Seg faults found by fuzzing in sfopen.

PCL would continue processing with a corrupt font. This could lead to
bad memory accesses as demonstrated by the fuzzing example. For now,
we return an error when a corrupt font is encountered and end the job.
Likely, a lighter approach is called for: continue process without
defining the font. This would be a bit more involved and we'll
consider it if users report HP precedent for the behavior.

pcl/pcsfont.c


2014-02-24 15:14:45 +0000
Ken Sharp <ken.sharp@artifex.com>
b6f8dba649f1be2ba5b9eb1d257f2052f7f2df28

Move ram file system memory to 'stable' memory

The RAM file system was using regular GC'ed memory for its storage, which is
subject to save and restore. The RAM file system should not, of course, be
subject to save and restore!

This commit prevents save and restore affecting the memory for the ramfs

No differences expected.

gs/base/ramfs.c


2014-02-14 18:16:55 +0100
Simon Bünzli <zeniko@gmail.com>
863a1dfb328298a39871e49d218a16781fd42cba

Bug 694880 and bug 694904: prevent heap overflow in opj_j2k_add_tlmarker

Signed-off-by: Henry Stiles <henry.stiles@artifex.com>

gs/openjpeg/libopenjpeg/j2k.c


2014-02-14 18:20:36 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
b17894bfedaf7b76edac15f681a4bd08717c65c0

Bug 694906: fix potential heap overflow in opj_t2_read_packet_header

Signed-off-by: Henry Stiles <henry.stiles@artifex.com>

gs/openjpeg/libopenjpeg/t2.c


2014-02-18 09:36:09 +0000
Chris Liddell <chris.liddell@artifex.com>
7bd3739a888f70edf0270891782a88a547f5e829

Make the OpenJPEG callbacks static.....

and give them names more likely to be unique (just for debugging convenience).

No cluster differences.

gs/base/sjpx_openjpeg.c


2014-02-18 11:22:16 -0800
Ray Johnston <ray.johnston@artifex.com>
174cfd14e4d34a37cdcf2e0372bd0b4334310e8b

Fix pngalpha when PDF has transparency. Bugs 687630, 693024 and 695042.

We needed a pngalpha_put_image procedure to properly collect the pdf14
compositor alpha value. Note that this is NOT simple 0 or 1 alpha, but
the actual effective page level opacity from the PDF. Note that some
viewers may not correctly display these despite this being part of
the PNG spec.

gs/devices/gdevpng.c


2014-02-15 13:54:07 -0800
Ray Johnston <ray.johnston@artifex.com>
b69da60516576d65ce1e27087dc358fef067ec58

Fix bug 695405. The psdcmykog device should not lock num_components.

This regression was introduced with an attempt to fix SeparationOrder
handling, but is not needed because we throw an error when there is
an attempt to set the SeparationOrder, and the device is confused
when the num_components is reset in the open_device procedure.

gs/devices/gdevcmykog.c


2014-02-11 08:07:04 -0800
Ray Johnston <ray.johnston@artifex.com>
3ebdb4596c8fa05656dc3987553217efe72b6b8d

Improve chunk allocator performance using a doubly linked list (bug 694985)

Thanks to Norbert Janssen for the linked list logic. Also make a couple
of other improvements in the free_object logic and use a separate
structure for the freelist to avoid confusion with object nodes.

gs/base/gsmchunk.c


2014-02-14 14:07:11 +0100
Tor Andersson <tor.andersson@artifex.com>
c5ad5b7f373313e9bc7b8991cc9e34506e627e0a

xps: Fix memory leaks in xpszip.c when handling errors.

Thanks to Norbert Janssen.

xps/xpszip.c


2014-02-14 10:12:28 +0000
Ken Sharp <ken.sharp@artifex.com>
1e93c580b175ac086db942c32fab055c6062e8e4

ps2write - more colour conversion work

Bug #694774

When outputting to PostScript we don't preserve certain colour spaces which
either cannot be represented in PDF (CIEBased) or in level 2 PostScript
(ICCBased/Lab/DeviceN) are not preserved. These should be written as device
colours instead, but this wasn't always happening correctly.

This commit should resolve this, and should now make it possible (but still
inadvisable) to use -dUseCIEColor with both pdfwrite and ps2write.

A small number of files show (frankly imperceptible) colour shifts with
ps2write with this change.

gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfg.c


2014-02-13 14:49:42 +0000
Chris Liddell <chris.liddell@artifex.com>
edbed246ed67fcf24f854795f0d703bcb5d902fe

Bug 695027: use a consistent allocator in the FT server

There was some mixing of memory allocators in the Freetype integration code,
most of the code used the chunk allocator instance created during the
server initialization, but glyph data allocations were using the allocator from
the font object.

With two different FAPI servers in place, and with the right combination of
events, that could mean we'd lose the allocator pointer when destroying
the font object.

We're consistent in that all the memory allocations in the FAPI/Freetype code
are directed through the chunk allocator created for that purpose.

No cluster differences.

gs/base/fapi_ft.c


2014-02-13 14:47:18 +0000
Chris Liddell <chris.liddell@artifex.com>
979d824c9da11e9f366b1d90aed06f9449127997

Bug 695024: fix a typo

In the UFST integration code, we check if the Freetype server is available
and if it is, we punt any non-Microtype fonts to that. The typo is that
the Freetype server is named "FreeType" - the "T" was lower case.

CLUSTER_UNTESTED

gs/base/fapiufst.c


2014-02-13 15:14:49 +0000
Ken Sharp <ken.sharp@artifex.com>
4d349b1ae5852db20fcaca21b357748eb5360817

Bug #695034 Improve handling of word spacing with CIDFonta

Bug #695034 "Numbers and words are overlapping"

Word spacing does not apply to ti CIDFOnts, *except* for 1-byte mappings
where the byte 0x20 has word spacing applied to it.

The previous code attempted to check this by using a heuristic to determine
a single byte mapping in order to avoid adding more entries to the text
enumerator. unfortunately this file defeats that heuristic which meant
that it was necessary to calculate the number of bytes decoded when we
extract one character, and store that information so that the 'move'
routine can apply word spacing if required.

This shows two differences with a cluster run. Bug694436.pdf is very subtly
different, I'm assuming this is a progression. The Sumatra file
850_-_wrong_default_for_asian_fonts.pdf shows very significant improvements
with this commit.

gs/base/gxchar.c
gs/base/gxtext.h


2014-02-11 15:15:56 +0000
Chris Liddell <chris.liddell@artifex.com>
f4584b0e162a96ec143f0057de63c116e649e02b

Bug 695031: don't assume we can read a font file

When we scan system fonts, we were assuming fonts found would be in a format
Ghostscript understands. This is not necessarily the case.

So put the minimal parsing call to get the font's name in a stopped context,
so we can skip the file it's not an understandable format. And clean up the
stack in the event we try such a file.

No cluster differences.

gs/Resource/Init/gs_fonts.ps


2014-02-11 12:14:33 -0800
Michael Vrhel <michael.vrhel@artifex.com>
149b4b33c909c2d67c44c7a820f70209294bee76

Don't allow PS CIE color spaces to be used for transparency group color spaces.

The CIE color spaces are 1-way. In that they map from Device to CIE, not from
CIE to Device. A transparency group color space needs to be able to go both
directions. This fixes the regression 694774

gs/base/gsicc_cms.h
gs/base/gsicc_lcms2.c
gs/psi/int.mak
gs/psi/ztrans.c


2014-02-11 11:18:39 -0700
Henry Stiles <henry.stiles@artifex.com>
c22a604f0dc176fe1ae7545097e8a818e5d38309

Remove final remnants of deprecated CRD code.

pcl/pccid.c
pcl/pcl.mak
pl/pl.mak
pl/plsrgb.c
pl/plsrgb.h
pxl/pxgstate.c
pxl/pximage.c
pxl/pxink.c
pxl/pxl.mak
pxl/pxsessio.c


2014-02-11 08:07:04 -0800
Ray Johnston <ray.johnston@artifex.com>
c240594f3083158ab829cd121159879183bf49c8

Improve the debug 'cname' for chunk_mem_node_add similar to MEMENTO builds.

For normal builds use the caller's cname when allocating the chunk if the
object is in its own chunk. Previously this only was used for MEMENTO builds.
NB: MEMENTO builds put every object in a chunk, so the cname will always be
the caller's, never "chunk_mem_node_add".

gs/base/gsmchunk.c


2014-02-09 11:48:35 -0800
Ray Johnston <ray.johnston@artifex.com>
0eaf9e76f83eff5d0dd5eb1f8d9a5314b9ca44cd

Fix bug 694821. Ignore SeparationOrder with the psdcmykog device.

While this is a DeviceN device with some non-standard components
that can be painted using Separation or DeviceN colorspaces, this
device always outputs all 6 channels and can't deal with a subset
of the channels, so return an error (undefined) for SeparationOrder.
the separation_map remains constant to avoid color distortion if
SeparationOrder is used.

Also make sure that we never add separations (NO_AUTO_SPOT_COLORS)
from the get_color_comp_index procedure.

gs/devices/gdevcmykog.c


2014-02-07 18:13:52 -0800
Ray Johnston <ray.johnston@artifex.com>
a11848051b9abdbe2b750976018d4167a96d2fea

Fix some problems with SeparationOrder handling -- 29-07I.PS

Most importantly, when setting SeparationOrder parameters fail, we
need to use param_signal_error. Otherwise, even though the error code
is returned, the stack for setpagedevice would be missing the param
information and code that caused the error.

Also the num_spot and num_spot_changed were improperly updated when
ENABLE_AUTO_SPOT_COLORS allowed SeparationOrder to add separations.

gs/base/gdevdevn.c


2014-02-11 09:33:13 +0000
Ken Sharp <ken.sharp@artifex.com>
f176e516add62d3a943a755a9294c510c579655d

pdfwrite - fix a bug in the font embedding white list detection

While working on bug #695030 I ran across a bug in the font embedding
white list code. If the bisection of the list exactly hits the target string
exactly then the bisection would fail to find the string.

This commit special cases this and detects the string.

No differences expected.

gs/devices/vector/whitelst.c


2014-02-10 11:17:01 +0000
Ken Sharp <ken.sharp@artifex.com>
fac814792b42dfc2baafe84062ff986b7620cfe3

pdfwrite - alter the example pdfa_def.ps for PDF/A generation

The pdfa_def.ps file is incorrect with the new colour handling, and has long
had a problem with only handling Gray or CMYK.

Its no longer possible to retrieve the ProcessColorModel from systemdict,
we must now use the current device dictionary.

pdfa_def.ps now supports DevuiceGray, DeviceRGB and DeviceCMYK models.

No differences expected

gs/lib/PDFA_def.ps


2014-02-10 11:14:31 +0000
Ken Sharp <ken.sharp@artifex.com>
e17abc0e4574cdefd25032aa1003ff28503b5867

pdfwrite - new color code. Fix the emission of DeviceIndependent colours

Bug #694806 "chars and colors lost during PDF/A transformation"

If we used the same device independent (ICCBased) colour space, but a
different colour, we ended up not writing the new colour. This code fixes
that problem.

No differences expected

gs/devices/vector/gdevpdfg.c


2014-02-10 08:34:54 +0000
Ken Sharp <ken.sharp@artifex.com>
d59e1feb9545b399027907cb2d1a6855c524e0b4

PS interpreter - Fix rotation problem with EPSFitPage

Bug #695016 "Gradient eps file to pdf"

When fitting an EPS Bounding Box to a specified page size, the code looks
at the width and height of both the page and the EPS file, to see if the
EPS will fit 'better' by rotating it.

In this particular case the page is square, but there was no special case
for this, which mean that landscape pages wold be rotated twice, causing
the content to disappear.

This commit special cases square media sizes and does not attempt to rotate
the EPS, no matter what its orientation, as there is clearly no point in
doing so. This prevents the double rotation and resolves the problem.

Tested with landscape, portrait and square media and EPS files, in all
combinations.

No differences expected

gs/Resource/Init/gs_epsf.ps


2014-02-06 09:56:43 -0800
Ray Johnston <ray.johnston@artifex.com>
dc3770910997a17386c65eaa44e73cf7cf5e8339

Fix Windows display device -dDisplayFormat=16#a0800 regression.

Commit 82fc3bd change to msvc.mak removed setting the GX_COLOR_INDEX_TYPE,
and code in base/gxcindex.h set this incorrectly to 'ulong'. Add the code
that was removed and also add conditional compile to set this from
ARCH_SIZEOF_GX_COLOR_INDEX if it is not defined.

Also add a 'compile time assert' that causes the build to fail if the
sizeof(GX_COLOR_INDEX_TYPE) is not equal to ARCH_SIZEOF_GX_COLOR_INDEX.
Thanks to Robin for finding this trick on the web.

gs/base/gxcindex.h
gs/base/lib.mak
gs/psi/msvc.mak


2014-02-06 09:53:55 +0000
Ken Sharp <ken.sharp@artifex.com>
ab3faf9dd8b61b7adc83f370e8caf40f09a442bb

pdfwrite - improved error handling in pdf_close

Bug #695013 " GS not finishing pdf write, creating huge files, when root / partition is full"

we weren't checking the error return when trying to find the end of an
xref section while writing the xref. Any ioerror would havce caused this
problem.

While this fixes the specific instance of the problem, I can't guarantee
that more subtle problems (eg filling disk while writing the PDF file)
don't still exist.

No differences expected.

gs/devices/vector/gdevpdf.c


2014-02-05 14:19:59 +0000
Ken Sharp <ken.sharp@artifex.com>
ff033b6ec050f23cb7b1e6ff52bb48fb45afd9e3

Update jbig2dec standalone build for Windows.

Add the missing jbig2_halftone.c file, and make building without libpng
the default.

CLUSTER_UNTESTED

gs/jbig2dec/msvc.mak


2014-02-04 13:35:04 -0800
Michael Vrhel <michael.vrhel@artifex.com>
a75ff89833289614e0dc2476c822462670f822bc

Remove strdup in gdevxps.c .

In Windows 8 64 bit builds with VS2012/2013 strdup use resulted in a crash. Replaced
with standard strlen/gs_alloc_bytes/strcpy. Note that we need to free this allocation at some point.

gs/devices/vector/gdevxps.c


2014-01-23 09:53:23 +0000
Chris Liddell <chris.liddell@artifex.com>
8033bcb40edf7520682cb14ee41226eddf9c8e5e

Tweak xpsprint build.

Conflicts:
gs/base/msvctail.mak
gs/base/winlib.mak
gs/devices/vector/gdevxps.c

Tweak the xpsprint code to use runtime DLL loading

Conflicts:
gs/base/msvctail.mak

gs/base/msvctail.mak
gs/base/winlib.mak
gs/base/xpsprint.cpp
gs/devices/devs.mak
gs/devices/vector/gdevxps.c
gs/psi/msvc.mak


2014-01-21 12:01:41 +0000
Ken Sharp <ken.sharp@artifex.com>
d10c375e190876fef3f431e17c47dcacda03d567

Add new code for a 'gsprint' alike which uses the XPS print system on
WIndows

Add new code for a 'gsprint' on new versions of Windows, using XPS

gs/base/xpsprint.cpp
gs/devices/vector/gdevxps.c


2014-02-03 07:18:16 -0800
Ray Johnston <ray.johnston@artifex.com>
4eb758e74c73c03b113ba2bf73245f21b1c6de14

Fix writes to freed memory caused by commit 429640.

I had moved the clearing of the ctx to before the gs_malloc_release
call, but this function frees the ctx, so we wrote to freed memory.
Move it back.

gs/psi/iapi.c


2014-01-31 12:24:25 -0800
Ray Johnston <ray.johnston@artifex.com>
363f3bc0d3b6206cc1e0aff0ce2fe954c0295409

Fix bug 694994. Gray and CMYK pdf14 clist accumu devices had wrong color_info.

In cut and pasting the device structures, I negleccted to change the color
info for the macros.

gs/base/gdevp14.c


2014-02-01 12:10:22 +0000
Ken Sharp <ken.sharp@artifex.com>
2f2970c2a35a146f21631612adfca48a0b1bb2b3

PDF interpreter - disable Comment parsing for PDF files

Bug #694987 "PDF metadata messed up for PDF->PDF conversion"

This is caused by parsing DSC comments from an embedded font file. Of course
the font should not contain DSC comments, but it seems FontForge always
embeds such.

There is nothing useful to be gained from *PostScript* comments in a PDF
file, so the simplest solution is to disable comment parsing for the
duration of the PDF file.

This will also avoid problems with PostScript XObjects.

No differences expected

gs/Resource/Init/pdf_main.ps


2014-01-31 15:08:17 +0000
Chris Liddell <chris.liddell@artifex.com>
161559d289a9b4306673c7d7e089182670c5090a

Slightly rejig i/o in inkcov device.

Tweak so that output directed to stdout or stderr go through the graphics
library's own stdout and stderr handlers - that way, it can be seen by
integrators using the Ghostscript API with custom stdio handler methods.

No cluster differences.

gs/base/gdevprn.c
gs/base/gslibctx.h
gs/devices/gdevicov.c


2014-01-31 14:50:55 +0000
Ken Sharp <ken.sharp@artifex.com>
7ef7b0d503fee02da12430ee19a394b23b1bfa6f

pdfwrite - colour conversion, consider sRGB to be RGB

gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfi.c
gs/devices/vector/gdevpdfp.c


2014-01-31 09:42:38 +0000
Ken Sharp <ken.sharp@artifex.com>
a2a785d3f6111410198c396fe21813ddd41664be

PDF interpreter - add -dUseBleedBox to complete the quartet of Boxes

Bug #694977 "please provide -dUseBleedBox in analogy to crop- and trimbox"

gs/Resource/Init/pdf_main.ps
gs/doc/Use.htm


2014-01-31 08:19:31 +0000
Ken Sharp <ken.sharp@artifex.com>
6c4e66f6a7a1e9fc3ed3beff84549aa3bbbbe795

pdfwrite - remove 2 unused variables

silences compiler warnings

gs/devices/vector/gdevpdfm.c


2014-01-30 11:08:55 -0800
Ray Johnston <ray.johnston@artifex.com>
429640b32e1ffcd324c2b44daa1fb35ef41c01d4

Move final memory (max) usage to gs_malloc_release.

Not all systems (e.g. unix) use the gsapi interface, so the debug
-Z: didn't print the final memory usage as on Windows.

gs/base/gsmalloc.c
gs/psi/iapi.c


2014-01-30 15:32:23 +0000
Ken Sharp <ken.sharp@artifex.com>
ea83541f7fcc1af40cf62f0e7457df74e8b427c4

pdfwrite - more EMBED pdfmrk changes

commit 3e5ae4ea39655643ae352cf4723702a164c10417 omitted a crucial change
which swapped the search order of /FS and /Name. Without that the dict
entries are not correctly named.

This oversight demonstrated a flaw in the error handling resulting in invalid
PDF files being written, which we correct here. If we get an error we close
the 'aside' so that we don't end up writing the PDF trailer to a temporary
file instead of the real PDF file.

No differences expected

gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfo.c


2014-01-30 10:00:23 +0000
Ken Sharp <ken.sharp@artifex.com>
3e5ae4ea39655643ae352cf4723702a164c10417

pdfwrite - more work on /EMBED pdfmark

As was rather anticipated, commit a91d2576df0e60f6e691a3bd967b51109ae41f22
wasn't sufficient. We were writing an invalid name tree as we were writing
/Limits in the root node. For single entries in the Limits array we only
wrote the single entry, in fact we should write that entry twice (!). The
value associated with each key in the EmbeddedFiles array had the dictionary
we needed stored inside another dictionary with a /FS key. EmbeddedFiles
were introduced in PDF 1.4, not PDF 1.2.

This commit addresses all those problems, Adobe Acrobat Professional can
display the list of embedded files and (for embedded PDF files at least)
can open the embedded file.

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfo.c


2013-11-26 11:15:17 -0800
Ray Johnston <ray.johnston@artifex.com>
4e44c995bcc7a2aa6c32e23cb73fd532a93f5b1c

Fix bug 689805: Use a clist for pages with transparency that need lots of RAM

Devices that are not gx_device_printer class try to allocate full page bitmaps
for the stack of transparency buffers. This can kill performance or result in
VMerror during transparency stack pushes. Devices that are gx_device_printer
class automatically used clist mode, but other devices did not. Devices that
do not internally support clist mode are recognized by the return from
gxdso_supports_saved_pages device spec_op.

A gx_device_printer device is used to accumulate the page, then when the
PDF14_POP_DEVICE is performed, the page is sent to the original device
as an image.

NB, both the pdf14clist___ device and the pdf14___ device are kept in the
device chain since we have to be able to accomodate unwinding the gs_state
structure that may point to either as various "restore" ops occur.
Unfortunate, but until we come up with a way to fix the chain of compositors,
this is the best we can do.

Move space_params to gx_device struct in order to allow non-printer devices
control over MaxBitmap, BufferSpace, BandBufferSpace, and BandHeight. The x11
device used MaxBitmap somewhat differently, so it now uses the space_params
value, and sets the default in its 'open' function, rather than the device
prototype. The duplicate 'page_uses_transparency' in space_params is removed,
and all devices have this as a parameter.

Also, get rid if the nasty hacks for detecting pattern-clist devices based on
the device name, and export these for the pdf14 device and other clients.

Finally, (unrelated) remove the #if 0 for testing with small memory on
large memory machines, and get rid of the the description of the '.' option
since this hasn't worked for years, and the command line options can readily
be set anyway.

gs/base/gdevp14.c
gs/base/gdevprn.c
gs/base/gdevprn.h
gs/base/gsdparam.c
gs/base/gsptype1.c
gs/base/gsstate.c
gs/base/gstrans.c
gs/base/gxband.h
gs/base/gxclbits.c
gs/base/gxclimag.c
gs/base/gxclist.c
gs/base/gxclist.h
gs/base/gxclpage.c
gs/base/gxclrast.c
gs/base/gxdevcli.h
gs/base/gxdevice.h
gs/base/gxpcmap.c
gs/base/gxpcolor.h
gs/base/lib.mak
gs/devices/gdevbit.c
gs/devices/gdevplib.c
gs/devices/gdevx.c
gs/devices/gdevx.h
gs/devices/gdevxini.c
gs/doc/Use.htm


2014-01-29 17:32:04 +0000
Ken Sharp <ken.sharp@artifex.com>
a91d2576df0e60f6e691a3bd967b51109ae41f22

pdfwrite - enable the EMBED pdfamrk

Bug #690043 "Can't create a pdf file with attachment"

This turned out to be more complex than I expected. I had planned to lever
off the /Dests code, but....

It seems that our Named destinations support is only PDF 1.1. The specification
was changed ion PDF 1.2 to use a name tree instead of a simple dictionary
and we didn't alter our code. The EmbeddedFiles wasn't supported in PDF 1.1
so it has always needed a name tree.

So in addition to adding the EMBED pdfmark, we now also will write a name
tree for Dests if the CompatibilityLevel is > 1.1. Note that the 'tree'
we write is the simplest possible one and is likely to be sub-optimal, we
write all the entries in the root of the tree. However its legal and should
work, we can extend this later if needs be.

I don't have a good way to test this, but the output looks OK by inspection
and we don't get any regressions.

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfo.c
gs/devices/vector/gdevpdfo.h
gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpdfx.h


2014-01-29 13:07:34 +0000
Robin Watts <robin.watts@artifex.com>
2dae08db5c51c9a255b8d18ef011f75c4ee48e9f

Fix non gcc DEBUG builds of pcl.

Simple transposition of lines required.

pcl/pcsfont.c


2014-01-28 17:21:48 +0000
Ken Sharp <ken.sharp@artifex.com>
f471820635cbbaf4f7ed5c9185700ebb51378f0d

PDF interpreter - attempt to recover from degenerate text matrix or CTM

Some PDF files set a degenerate matrix or text matrix, eg

0 0 0 0 0 0 Tm

This causes us a problem with currentpoint and .getpath, both of which
need to invert the CTM. If the CTM is all 0 then it (clearly) can't be
inverted.

The code here emits a warning, in the case of settextposition it simply
does not advance the current point (which seems correct, since the text
will make no changes). In the case where we attempt to grestore (Q) but
preserving the current path, we drop the path and make a new path. This
may well not be correct, but its hard to see what would be.

No differences expected.

gs/Resource/Init/pdf_ops.ps


2014-01-23 09:17:31 +0000
Ken Sharp <ken.sharp@artifex.com>
e46be795d1a682259ebcca3df2ad581150414adf

epsi.ps - change two \r to \n

Apparently gv has a bug and can't handle \r line endings.

Bug #694968

No differences expected.

gs/lib/ps2epsi.ps


2014-01-23 09:09:48 +0000
Ken Sharp <ken.sharp@artifex.com>
03376079a8c05dd2224c057aaa95c508521ce784

vector devices - add a warning message when OutputFile exceeds a limit

Bug #694948

No differences expected.

gs/base/gdevvec.c


2014-01-11 16:53:48 +0000
Hin-Tak Leung <hintak@ghostscript.com>
49bb8200d6c92ddcd191026c0273f8bc229ad9e0

Bug 694873: bare JPEG2000 images without JP2 header in pdf.

To cope with JPEG2000 images without JP2 headers.

This change is essentially the corresponding change in mupdf
(https://code.google.com/p/sumatrapdf/issues/detail?id=937 ,
http://bugs.ghostscript.com/show_bug.cgi?id=691346 ,
test file 937_-_openjpeg_cannot_decode_JP2_structure.pdf),
where one takes a peek at the first few bytes of the stream
before setting the decoding parameters; with the caveat that
in ghostcript, we need to delay most of the stream
initialization - and allocation of resources - until
after seeing the first few bytes, and therefore also
not necessarily de-allocate at stream close.

The cluster test file, openjpeg_166_-_buffer_overflow.pdf,
(https://code.google.com/p/openjpeg/issues/detail?id=166)
is of the same issue.

EXPECTED DIFFERENCES:
937_-_openjpeg_cannot_decode_JP2_structure.pdf
openjpeg_166_-_buffer_overflow.pdf
(Both are progressions.)

gs/base/sjpx_openjpeg.c


2014-01-22 22:06:51 +0100
Till Kamppeter <till.kamppeter@gmail.com>
5d6b18aa6a2a4ece4854ed9af074bb65f41af293

Set correct portrait/landscape orientation on PCL 5c/e output

Fixes bug #693715.

gs/devices/gdevdjet.c
gs/devices/gdevdljm.c
gs/devices/gdevpcl.c
gs/devices/gdevpcl.h


2014-01-20 13:18:23 +0000
Ken Sharp <ken.sharp@artifex.com>
c699e89a897b85d2f1f0a07ecac8d64b53500804

pdfwrite - fix xref when eliding duplicate patterns

commit fe99ca5fd2e3b191a76c7f7d791b72f3603e9fea detected duplicate shading
patterns, and did not emit them into the PDF file, instead using the first
definition. Unfortunately, due to a mis-understanding of the existing code
the xref entry remained assigned, which led to invalid xref tables
being written.

This commit fixes the xref, and adds some (hopefully useful) comments to
the relevant functions to try and avoid a repetition.

No differences expected

gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpdfv.c


2014-01-17 12:37:24 -0700
Henry Stiles <henry.stiles@artifex.com>
54927dd449c476b5a8c125e9beb1fbe06bebc45e

Fix 694951 - No output produced.

Allow the HPGL/2 command "PG" to initialize the GL/2 parser at the
beginning of a job.

pcl/pcparse.c


2014-01-15 02:00:12 +0100
Simon Bünzli <zeniko@gmail.com>
b13ef732907219b48757e2f501486f71b9f21030

Bug 694893: prevent overflow in opj_int_ceildivpow2

This can be seen e.g. in:

4241ac039aba57e6a9c948d519d94216_asan_heap-oob_14650f2_7469_602.pdf

Thanks to Mateusz Jurczyk and Gynvael Coldwind of the Google Security
Team for providing the example files.

gs/openjpeg/libopenjpeg/opj_intmath.h


2014-01-14 23:11:43 +0100
Simon Bünzli <zeniko@gmail.com>
5b0c9985e3359aca9b3fcfd94424166aa61a141a

Bug 694880: fix write access violation in opj_j2k_add_tlmarker

A tile_index' current_tpsno may be far larger than the number of tile
parts because opj_j2k_read_sot increases that number just by 10 instead
of growing it to the actually required size.

This can be seen e.g. in:

147af3f1083de4393666b7d99b01b58b_signal_sigsegv_130c531_6155_5136.pdf

Thanks to Mateusz Jurczyk and Gynvael Coldwind of the Google Security
Team for providing the example files.

gs/openjpeg/libopenjpeg/j2k.c


2014-01-14 22:45:49 +0100
Simon Bünzli <zeniko@gmail.com>
7366747076f3b75def52079bd4d5021539a16394

Bug 694949: prevent denial of service with arithmetic decoding

Badly constructed Jbig2 images using arithmetic decoding may result in
a denial of service attack by causing huge images to be created and
initialized from no data at all (at EOS, the arithmetic decoder always
returns the same values instead of failing).

Two cases are prevented with this patch:
* huge generic regions with barely any data to decode it from
* a huge list of height classes with no data at all to decode it from

This can be seen e.g. in:

b534b5caad95dd405735ec9a079fd43b_asan_heap-oob_14bf3ce_6977_5690.pdf

Thanks to Mateusz Jurczyk and Gynvael Coldwind of the Google Security
Team for providing the example files.

gs/jbig2dec/jbig2_arith.c
gs/jbig2dec/jbig2_arith.h
gs/jbig2dec/jbig2_generic.c
gs/jbig2dec/jbig2_symbol_dict.c


2014-01-17 09:35:36 +0000
Ken Sharp <ken.sharp@artifex.com>
24dce021d5f774dd4264011cbd64bb4afb5aa51c

PDF interpreter - Don't set UseCIEColor unless actually required.

The PDF specification says that if a PDF file contains a page which uses
a ColorSpace Resource of DefautlGray, DefaultRGB or DefaultCMYK then this
should be regarded as a "request that such colors be systematically
transformed (remapped) into device-independent CIE-based color spaces.".
Essentially the PDF equivalent of UseCIEColor.

This does rather beg the question of why not specify the colours in a
device-independent space in the first place.....

In any event, in order to achieve this the PDF interpreter pulls some
tricks. We start by defining the Default* resources as the equivalent
Device* spaces and *always* define UseCIEColor to true. Thus whenever
we set a device color space the colour machinery tries to use instead the
appropriate Device* space. Because the color space machinery has an
optimisation to jump straight out when the requested space is the same as
the current space, this means that the UseCIEColor transformation should
have no effect.

However, pdfwrite now emits a warning if UseCIEColor is true, so we want
to avoid unconditionally setting UseCIEColor (I also find it horrifying that
we do this terrible hackery).

This commit borrows code used to set the Default* spaces if they exist on
a page, and uses it to detect such spaces before we call setpagedevice
for each page. We now only set UseCIEColor if the page actually uses one
of the Default* spaces and therefore requires it.

I did consider trying to substitute the defined colour space with the
Default* space whenever a colour space definition takes place and a Default*
space is defined, but gave up as there were simply too many places where
color spaces could be defined.

This code does (somewhat unexpectedly) produce some differences.
These are either progressions or very tiny differences, and I feel that
*not* setting UseCIEColor should be preferable anyway. (The real puzzle
is why some PostScript files seem to differ, but they only differ when
sent to pdfwrite and the PDF is then interpreed. Looks like UseCIEColor
has some strange behaviour with ICCBased spaces).

with pdfwrite:
altona_technical_1v2_x3.pdf - very minor colour shift
altona_technical_v20_x4 - progression on page 7
09-31.ps - difference in gray ramp in CIE space
09-34.ps - indetectable differences in some CIE colours

all devices:
Bug692783.pdf - indetectable shits in background
Catx5720.pdf - slight colour shifts in 3 graphics
1021_-_transparency-issue.pdf - tiny colour shifts
1141_-_background_shading_cropped.pdf - tiny colour shifts

gs/Resource/Init/pdf_main.ps
gs/devices/vector/gdevpdf.c


2014-01-14 20:09:53 +0000
Chris Liddell <chris.liddell@artifex.com>
ec1c4adcc5fab850e4038c4d5392adddd265c67e

Bug 694871: move libjpeg away from gc memory

Change the libjpeg interface code to use a chunk allocator instead of garbage
collected, "unstable" memory.

Previously, the libjpeg integration used "Postscript" memory, that is, memory
that is subject to garbage collection and save/restore operations.

This means that Postscript like:
/In (file) (r) file /DCTDecode filter def
save
<<
...
/ImageSource In
...
>> image
restore
In closefile

would almost certainly cause a crash, since the memory allocated by libjpeg
during the decoding for the "image" operator would be freed by the "restore"
operator, *before* the "closefile" destroyed the filter stream and the
libjpeg context.

If we opt to always wrap the "default" heap allocator in a chunk allocator
then we should probably remove the chunk allocator instances created
specifically for libjpeg.

No cluster differences.

gs/base/gsstruct.h
gs/base/lib.mak
gs/base/sdct.h
gs/base/sdctc.c
gs/base/sdctd.c
gs/base/sdcte.c
gs/base/sjpegc.c
gs/devices/vector/gdevpsdi.c


2014-01-15 12:54:43 +0000
Chris Liddell <chris.liddell@artifex.com>
c95dd5ba2cfd9b36aa3a18e7725089a741b7fa70

Have DSC parser use GS memory handling

The DSC parser was using it's own default memory alloc/free functions which
just called the libc malloc/free.

This tweaks our integration code so the parser will use the Ghostscript memory
management functions.

There are no changes to the parser code, the changes are entirely confined to
integrating the parser with our PS interpreter.

No cluster differences.

gs/psi/zdscpars.c


2014-01-09 23:05:43 +0100
Simon Bünzli <zeniko@gmail.com>
8ec8321df613986e8642e2975f7182072eb4be62

make opj_stream_set_user_data accept a NULL stream

... for consistency with opj_stream_set_* which does so.

gs/openjpeg/libopenjpeg/cio.c


2014-01-09 22:56:54 +0100
Simon Bünzli <zeniko@gmail.com>
d6121c78a0fc6c8cd87c6495e11d327068518c35

prevent assertion under MSVC on impossibly large allocations

MSVC's debug CRT asserts that arguments to malloc and realloc aren't
impossibly large (close to (size_t)-1) which makes testing fuzzed files
impossible with assertions enabled.

Problem found in a test file, 2236.pdf.asan.40.1376 supplied
by Mateusz "j00ru" Jurczyk and Gynvael Coldwind of the Google
Security Team using Address Sanitizer. Many thanks!

gs/openjpeg/libopenjpeg/opj_malloc.h


2014-01-09 22:54:36 +0100
Simon Bünzli <zeniko@gmail.com>
87b08a096bb8ad61f9dbe4811e208d9c9d7fe63b

don't define lrintf for MSVC 2013 (fix compilation breakage)

gs/openjpeg/libopenjpeg/opj_includes.h


2014-01-09 23:04:38 +0100
Simon Bünzli <zeniko@gmail.com>
0f07c3247cc9211e57bb5429634f79c8c762fbfa

fix error message in opj_jp2_read_colr

gs/openjpeg/libopenjpeg/jp2.c


2014-01-09 22:46:48 +0100
Simon Bünzli <zeniko@gmail.com>
2f4b1565c10fe6faa7ed3854a7fa3cd0a6e18511

tweak commit 66d9c0aa17a5abcecd6590e63f0620f7aa51634c

The fix for testcase 1336.pdf.asan.47.376 for bug 694311 was slightly
too strict: The access violation only happens during the MCT decoding
step which might be skipped for some images. This patch moves the test
into opj_tcd_mct_decode to only apply when it's actually required
(which should allow j2kp4-file3-ycc-8bpc.pdf to be read without errors
inside openjpeg itself and leaves handling of components of different
sizes to the calling application/library).

gs/openjpeg/libopenjpeg/tcd.c


2014-01-09 22:40:39 +0100
Simon Bünzli <zeniko@gmail.com>
0eedf7c22a76f089bbe13d76496ae56de38dfbef

tweak commit 99a6f1af177c15f4db475186b79d169c993494ef

Error messages should go to stderr instead of stdout so that tools such
as mudraw -t don't get stdout polluted.

gs/openjpeg/libopenjpeg/t2.c


2014-01-09 22:35:38 +0100
Simon Bünzli <zeniko@gmail.com>
fc884aee2b69c78500e65c3d05bf216791a9ea4a

prevent heap overflow in opj_t2_read_packet_header

Also prevent a double-free of segment data under OOM conditions.

Problem found in a test file, 1802.pdf.SIGSEGV.36e.894 supplied
by Mateusz "j00ru" Jurczyk and Gynvael Coldwind of the Google
Security Team using Address Sanitizer. Many thanks!

gs/openjpeg/libopenjpeg/t2.c


2014-01-09 22:32:37 +0100
Simon Bünzli <zeniko@gmail.com>
83dad6a76536222a3a51146f942e733a2e90ec52

fix potential NULL-pointer dereference

... caused by testing the wrong variable after opj_realloc
(happens only in OOM situations)

gs/openjpeg/libopenjpeg/jp2.c


2013-12-23 00:00:32 +0100
Simon Bünzli <zeniko@gmail.com>
dafa1945a18e79578335693a4e4c6247e2617ee2

jbig2dec: tweak overflow check in jbig2_(re)alloc

If num * size overflows under x64, the value may be negative and still
fit into a 32-bit integer. The proper check unfortunately requires a
division.

Note: The maximum allowed allocation is (size_t)-0x100 instead of
SIZE_MAX so that debug CRTs which check for the allocation of e.g.
(size_t)-1 never assert.

gs/jbig2dec/jbig2.c


2014-01-10 22:56:52 +0100
Simon Bünzli <zeniko@gmail.com>
5eaf740b2c02523ae2ae6454e546cb6700d4e3f3

Bug 694892: buffer overrun in jbig2_comment_ascii

gs/jbig2dec/jbig2_metadata.c


2014-01-10 22:30:16 +0100
Simon Bünzli <zeniko@gmail.com>
8b82970325b2bd9aa993aa16c214a915ec8210e3

follow-up to 8e2f00f15c988d75a4182ecdcdc1a82b4686ef92

This might fix bug 694903.

gs/jbig2dec/jbig2_symbol_dict.c


2014-01-12 22:12:35 +0100
Simon Bünzli <zeniko@gmail.com>
cddfd67f2df1863f8b06770e80e7c97bf970ccbb

Bug 694882: sanitize component mappings

PCLR, CMAP and CDEF data aren't properly sanitized - even after the
fixes from the last fuzzing round. This patch unifies all the required
checks in a new function opj_jp2_check_color which is invoked before
the cdef and cmap values are used.

This can be seen e.g. in:

66ea31acbb0f23a2bbc91f64d69a03f5_signal_sigsegv_13937c0_7030_5725.pdf

Thanks to Mateusz Jurczyk and Gynvael Coldwind of the Google Security
Team for providing the example files.

gs/openjpeg/libopenjpeg/jp2.c


2014-01-09 22:20:37 +0100
Simon Bünzli <zeniko@gmail.com>
f4139d702559649e577a5df9cfd64b0ca6107a7a

don't ignore buffer sizes

Several functions accept a buffer size but never actually check whether
the buffer overflows during reading/writing. This fixes all cases where
a size variable has explicitly been marked as unused (through a (void)
cast).

This was discovered while investigating an assertion caused by
7cc691f332f26802c64cdc47e17bff8b_signal_sigabrt_7ffff6d59425_2247_2509.pdf
among others.

Thanks to Mateusz Jurczyk and Gynvael Coldwind of the Google Security
Team for providing the example files.

gs/openjpeg/libopenjpeg/event.c
gs/openjpeg/libopenjpeg/jp2.c


2014-01-10 11:45:16 -0700
Henry Stiles <henry.stiles@artifex.com>
2c5cd8c29271d8735349353538c4a353f3aa563b

Debug option "-ZI" results improved or corrected with the goal of
creating output that can be reassembled back into PCL.

We have an assembler and disassembler for PXL: pxlasm.py, pxldis.py,
but they do not support PCL. For PCL we will use the GhostPCL
interpreter with -ZI and an upcoming Python program will read that
output and reassemble back to PCL.

pcl/pccid.c
pcl/pcdither.c
pcl/pclookup.c
pcl/pcommand.c
pcl/pcommand.h
pcl/pcpage.c
pcl/pcparse.c
pcl/pcpatrn.c
pcl/pcsfont.c
pcl/pcsymbol.c
pcl/pctext.c
pcl/pcuptrn.c
pcl/pglabel.c
pcl/pgparse.c
pcl/pgvector.c
pcl/rtmisc.c
pcl/rtraster.c
pl/plmain.c


2014-01-11 11:44:36 +0000
Ken Sharp <ken.sharp@artifex.com>
4a267d719148abf961f479ba6c9024bfa2c18bf5

pdfwrite - limit scan line comparison to actual width

Bug #694930 "Valgrind issues found by fuzzing in compute_subimage (gdevpdfd.c:707)"

The local image converter, and specifically mask to clip conversion,
compare consecutive scan lines of an image to see if they are identical.

However, they were using the width of the allocated raster, which can include
alignment padding, rather then the actual width of the image data. This
meant we were comparing uninitialised data. In this case its actually safe
as we would simply create a more complex clip than required, but its
definitely sub-optimal.

This commit changes the comparison to use the number of bits in the image,
rounded up to the nearest byte.

No differences expected.

gs/devices/vector/gdevpdfd.c


2014-01-09 16:08:15 +0000
Ken Sharp <ken.sharp@artifex.com>
20f6eb7d946cda9bd6b141881d1abd13daec911e

More error checking when copying fonts

Bug #694263 is again a fuzzing bug declared to demonstrate Valgrind errors
which for me causes a seg fault.

This again appears to be due to a broken TrueType font. The additional
checking in this commit resolves the problem for me.

gs/devices/gxfcopy.c


2014-01-09 12:04:51 +0000
Ken Sharp <ken.sharp@artifex.com>
49a05084feee92818347fbf888fc2ab784b82122

pdfwrite - initialise some variables to pacify valgrind

Bug #694236 does not give the valgrind warnings described in the bug
report for me, but did complain about the character widths. It seems
that somehow (broken font ?) the values were uninitialised. Here we just
set them to 0.

No differences expected

gs/devices/vector/gdevpdte.c


2014-01-09 11:13:02 +0000
Ken Sharp <ken.sharp@artifex.com>
e9a574ec0e6d13fcf898a7132ce08476af4ea84d

Don't attempt to copy a missing glyph when copying fonts

Bug #694236 for me does not (initially at least) cause a Valgrind warning,
but does cause a seg fault.

The problem is that we have a (presumably broken) TrueType font where we
try to enumerate all the glyphs in the font. The enumeration code returns
a GS_NO_GLYPH, but the font copying code doesn't catch that, and so tries
to copy that glyph. This causes a crash in the name lookup.

The commit here simply adds an additional check that the glyph is not
'GS_NO_GLYPH', if it is we treat it as an error.

No differences expected.

gs/devices/gxfcopy.c


2014-01-09 08:19:51 +0000
Ken Sharp <ken.sharp@artifex.com>
eb42d237028c3fd832664c5e1479483a430f5ed9

DSC parser - silence a compiler warning with a cast

gs/psi/dscparse.c


2014-01-08 10:57:46 -0700
Henry Stiles <henry.stiles@artifex.com>
b2ecdbba02eac6fa19866bd18c83ece7cdd4074d

Possible fix for 694837.

Allow the luratech jbig2 encoder to process 0 input without error like
all other streams encoders. Analysis by Ken Sharp.

gs/base/sjbig2_luratech.c


2014-01-08 16:12:53 +0000
Ken Sharp <ken.sharp@artifex.com>
32df3bf46606f697d7deae86211c897be63a0764

DSC parser - reset scanning at end of job

Currently the DSC parser never leaves 'scan_trailer', which is fine for
one-job-at-a-time usage, but not good for job server or multiple inputs.

This commit modifies the scan-trailer condition so that if a new DSC header
is encountered, *after* we've found a trailer, we reset some aspects of the
DSC parsing.

Note that this doesn't completely reset the parser as that caused memory
problems.

Bug #692208

No differences expected

gs/psi/dscparse.c


2014-01-08 08:26:14 +0000
Ken Sharp <ken.sharp@artifex.com>
cbeeef7f54bd183515f81d42176a049a7f7703a2

pdfwrite - add a warning if -dUseCIEColor is set

With the current color management its not really sensible to set UseCIEColor
(which was always a horrible hack anyway) in order to do color conversion
or management.

So if we see this being done, show the user a warning. We don't want to
raise an error as someone will undoubtedly complain that they have a good
reason for using UseCIEColor with pdfwrite.....

No differences expected.

gs/devices/vector/gdevpdf.c


2014-01-01 20:32:49 -0800
Ray Johnston <ray.johnston@artifex.com>
13b8f94c86efc4b98c7d63774b761bad9783f16c

Enable the pdf14 optimization. Previous commit only collected data.

Somehow, the previous commit that collected the data didn't actually
skip pdf14 transparency on any bands. Also testing showed that fiils
with patterns that needed transparency were not being detected.

We need to save the page mode pdf14_needed state based on the blend_mode
and opacity to restore to the correct setting after smask or transpacrency
group pushes.

Lastly, we punt if the device is not contone, since the colors written
for bands will be contone which are not compatible with the target.

Correct the pdf14_opmode_names to add in the missing PDF14_ABORT_DEVICE.

gs/base/gdevp14.c
gs/base/gstrans.h
gs/base/gxclist.h
gs/base/gxclpath.c
gs/base/gxclrast.c
gs/base/gxclread.c


2014-01-06 14:29:14 +0000
Ken Sharp <ken.sharp@artifex.com>
b86a214d542a91e526599aaadd2e68d896c1edff

pdfwrite - fix another memory allocator

After the previous problem caused by using the non-stable memory allocator
I reviewed all use of this allocator and nonticed that in this case we
allocate using the stable allocator, but were freeing it using the non-stable
allocator.

This probably only leaks memory but its best to fix it.

gs/devices/vector/gdevpdtd.c


2014-01-06 14:27:37 +0000
Ken Sharp <ken.sharp@artifex.com>
465eb2d291a92c8eda46c090c70594b4ef8f0fba

pdfwrite - add a comment explaining about pdev->pdf_mewmory

gs/devices/vector/gdevpdfx.h


2014-01-06 14:27:01 +0000
Ken Sharp <ken.sharp@artifex.com>
18f35e567b9e6760bf60a1f4c04b725cd343d5a9

pdfwrite - minor memory issue

Noticed while reviewing other problems, we didn't check to see if a memory
allocation was successful, and also; if a subsequent fread() failed we would
not free the allocated memory.

gs/devices/vector/gdevpdfo.c


2014-01-06 14:25:06 +0000
Ken Sharp <ken.sharp@artifex.com>
ba099db2df6867215178b7cfc1065eb921105d66

pdfwrite - squelch a compiler warning

undefine PDF_FOR_EPS2WRITE to prevent compiler complaning its redefined.

gs/devices/vector/gdevpdf.c


2014-01-06 10:39:41 +0000
Ken Sharp <ken.sharp@artifex.com>
ecf24042611a96c9d5560ccec845f3b2e4d70b38

pdfwrite - use stable memory for the outline tree

Bug #694868 "Regression: seg faults starting with 0790b03698b27dcf342e0175d2f833c921b5dab2"

The move of the outline tree to a dynamic allocation instead of static
accidentally used memory subject to save and restore instead of stable
memory. Oddly this only caused problems on the Linux debug build.

This commit moves the allocation to stable memory which I *believe* will
solve the problem. NB Chris is going to alter the allocation code so that
a debug build will flag this sort of problem up.

No differences expected.

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfm.c


2013-12-30 12:50:40 -0800
Michael Vrhel <michael.vrhel@artifex.com>
d4e6b106c336b8ae7db87f4bec6e0afb6993b687

Fixes for issues with the use of DeviceN source profiles

GC definitions were wrong for some of the structures and also name allocation size was wrong.
Fixes bug 694865

gs/base/gsicc_lcms.c
gs/base/gsicc_lcms2.c
gs/base/gsicc_manage.c


2013-12-20 18:19:23 +0000
Robin Watts <robin.watts@artifex.com>
6700dbf0d426ba8d6a707d639159b5b8db00a95c

Pass on an error code rather than ignore it.

gs/base/gdevp14.c


2013-12-22 23:22:42 -0800
Michael Vrhel <michael.vrhel@artifex.com>
17f0dfaf200163d7207f27f3cc34e0a1cf843203

Add missing case for UNKNOWN color space in transparency group.

This is used when the the new group did not specify a color space. We
were incorrectly returning an error. There is no error. The UNKNOWN
information is stored in the clist and when we later get the UNKNOWN
information we known to just keep the current color space.

gs/base/gdevp14.c


2013-12-23 10:30:04 -0800
Ray Johnston <ray.johnston@artifex.com>
72713e784ddaea275498a67e25ab77aedbc0eb9b

Fix bug 69365: Write pattern colors to all bands consistently for images.

Thanks to Michael Vrhel for tracking this down. If a transparent pattern
color is written to all bands after having been written to a band for
an image, the transparency fill_trans_buffer will be NULL because the
group for the image was pushed at 'begin_typed_image' time. We now write
the color to all_bands based on the image extent, consistently.

gs/base/gxcldev.h
gs/base/gxclimag.c
gs/base/gxclpath.c


2013-12-23 15:45:23 +0000
Ken Sharp <ken.sharp@artifex.com>
0790b03698b27dcf342e0175d2f833c921b5dab2

pdfwrite - convert outline tree to dynamic storage

Bug #690429 "convert outline tree from static array to dynamic list"

In the past the outline tree in pdfwrite was a hard coded array with a
maximum depth of 31. This array is now dynamically allocated, so the depth
is limited only by available memory.

No differences expected

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfx.h


2013-12-20 17:54:42 +0000
Robin Watts <robin.watts@artifex.com>
3574d5254bd93dc2b002f93de120043990c3fcda

Remove mistakenly added files.

clustercmd
clusterdatestamp


2013-12-18 07:56:31 -0800
Michael Vrhel <michael.vrhel@artifex.com>
6f8bb99dae2db541b7941d65816581137990be6d

Temp debug patch

gs/base/gdevp14.c
gs/base/gsptype1.c
gs/base/gxpcmap.c


2013-12-20 15:31:10 +0000
Robin Watts <robin.watts@artifex.com>
dcb60221c23d33e65ed2193f1f0e6355f06c12ab

Add more error handling missing from pdf14.

gs/base/gxblend1.c


2013-12-20 15:27:54 +0000
Robin Watts <robin.watts@artifex.com>
d355b00b5915697904a2c0f8a2334050d2c1bf32

Bug 694858: Add some missing error handling.

This solves at least some of the SEGVs.

clustercmd
clusterdatestamp
gs/base/gstrans.c


2013-12-20 10:05:58 +0000
Ken Sharp <ken.sharp@artifex.com>
ba28d0f50d9de48d8961f93044b5dac8139312f2

pdfwrite - update element linked list before freeing element in cos dicts

Bug 694854 "Converting pdf to PDFX standard crashes ghostscript right before the end"

When creating a PDF/X file the code deletes any BleedBox, TrimBox, ArtBox
entries from the page dictionary after writing them (ho idea why...) using
the cos_dict_delete() function.

The function frees the memory, and then updates the linked list of elements
in the dictionary, however it updates the list after freeing the memory. If
the free memory pointed to should alter before the linked list is updated,
then the list will be updated with garbage.

Updating the linked list *before* freeing the memory is a much better way
to proceed.

Because this is only called when creating PDF/X files, no differences are
expected.

gs/devices/vector/gdevpdfo.c


2013-12-19 22:30:39 +0100
Till Kamppeter <till.kamppeter@gmail.com>
615059129740d77fac1db1bbec4a79958d88e3bf

Fixed line conibuation typos in previous commit (d997bc4)

gs/cups/gdevcups.c


2013-12-19 00:41:19 +0000
Robin Watts <robin.watts@artifex.com>
77eb4f71f15365c713f1fec698a87203afaaf984

Add some error checking to pdf14.

When we record an error code, ensure we check it.

gs/base/gdevp14.c


2013-12-19 12:32:23 +0000
Chris Liddell <chris.liddell@artifex.com>
3c913314883114d671d550e5db9efa2192241040

Only issue the "unbalanced q/Q" warning once per page.

Write a flag to the pdfdict to indicate that we've already issued the warning
and skip it from then on for the current page. Reset flag at the end of the
page.

No cluster differences.

gs/Resource/Init/pdf_main.ps
gs/Resource/Init/pdf_ops.ps


2013-12-19 17:03:39 +0100
Till Kamppeter <till.kamppeter@gmail.com>
d997bc49531613205e055c8e4e25d93bb4c762e6

Added "pwgraster" output device

The "pwgraster" output device rasterizes the input into the PWG Raster
format, an industry-standarized raster format for printers, especially
the upcoming IPP Everywhere network printers which are supposed to
work with any hardware-model-specific software (drivers). As PWG
Raster is derived from CUPS Raster it is generated by the "cups"
output device, but calling it with the "pwgraster" name makes it
generating PWG Raster instead of CUPS Raster.

gs/configure.ac
gs/cups/gdevcups.c
gs/devices/devs.mak


2013-12-19 09:40:01 +0000
Ken Sharp <ken.sharp@artifex.com>
81b246414c4624cf476793c2590201de408ea33a

pdfwrite - don't allocate multiple object IDs for shadings

Bug #694853 "PDF/A generation does not fix all errors"

When the code to detect and elide duplicate shadings was added we used the
pdf_substitute_resource function to detect duplicates and drop the new one.

However this function *always* assigned a new object ID if it wasn't a
duplicate, which leaves the original ID dangling (if the object already had
one). This commit simply avoids creating a new ID if the object is not a
duplicate, and already has an ID.

I'm a little nervous about this one, but a cluster push seems to be OK. No
differences expected.

gs/devices/vector/gdevpdfu.c


2013-12-18 18:43:56 +0000
Robin Watts <robin.watts@artifex.com>
1a25414344c0a2c3b9c8947ad120d34845ecb387

Bug 693365: Add find_pdf14_device function, and use it.

This seems to solve the problem with simple6.pdf at least.

gs/base/gdevp14.c
gs/base/gsicc_monitorcm.c
gs/base/gspaint.c
gs/base/gxdevsop.h


2013-12-18 15:26:49 +0000
Robin Watts <robin.watts@artifex.com>
36f97ff44c7e94d1cf033a6495f2876b1976ca66

Bug 694258: Allow for floating point inaccuracies in pattern code.

When calculating the regions 'touched' by pattern repeats, allow for
inaccuracies in the floating point calculations.

gs/base/gsptype1.c
gs/base/math_.h


2013-12-18 15:06:17 +0000
Chris Liddell <chris.liddell@artifex.com>
b0cbadbbb03dffbf5f9ec9e72658f59e0e59238a

Remove floatp references in docs.

CLUSTER_UNTESTED

gs/doc/C-style.htm


2013-12-18 14:53:48 +0000
Chris Liddell <chris.liddell@artifex.com>
cf009c80c4a371ad64cc5c0444d72902657dbfce

Replace the "floatp" with "double"

For historic reasons, floating point parameters used the type "floatp" which
was actually typedef'ed to "double".

To reduce confusion, we now use "double" directly.

No cluster differences.

gs/base/fapi_ft.c
gs/base/gdevdcrd.c
gs/base/gdevdflt.c
gs/base/gdevvec.c
gs/base/gdevvec.h
gs/base/gsalpha.c
gs/base/gsalpha.h
gs/base/gscdevn.c
gs/base/gschar.c
gs/base/gschar.h
gs/base/gscie.c
gs/base/gscie.h
gs/base/gsciemap.c
gs/base/gscolor.c
gs/base/gscolor.h
gs/base/gscolor1.c
gs/base/gscolor1.h
gs/base/gscolor3.c
gs/base/gscolor3.h
gs/base/gscoord.c
gs/base/gscoord.h
gs/base/gscpixel.c
gs/base/gscrd.c
gs/base/gscrdp.c
gs/base/gsdevice.c
gs/base/gsdparam.c
gs/base/gsdps1.c
gs/base/gsfont.c
gs/base/gsfont.h
gs/base/gsfunc0.c
gs/base/gsfunc4.c
gs/base/gshsb.c
gs/base/gshsb.h
gs/base/gsht.h
gs/base/gsht1.c
gs/base/gshtscr.c
gs/base/gshtx.c
gs/base/gshtx.h
gs/base/gsicc.c
gs/base/gsicc_create.c
gs/base/gslib.c
gs/base/gsline.c
gs/base/gsline.h
gs/base/gsmatrix.c
gs/base/gsmatrix.h
gs/base/gspaint.c
gs/base/gspath.c
gs/base/gspath.h
gs/base/gspath1.c
gs/base/gspath2.h
gs/base/gsstate.c
gs/base/gsstate.h
gs/base/gstext.c
gs/base/gstext.h
gs/base/gstparam.h
gs/base/gstrans.c
gs/base/gstrans.h
gs/base/gxccache.c
gs/base/gxchar.c
gs/base/gxchar.h
gs/base/gxchrout.c
gs/base/gxchrout.h
gs/base/gxclimag.c
gs/base/gxclpath.c
gs/base/gxcmap.c
gs/base/gxcolor2.h
gs/base/gxdevcli.h
gs/base/gxdevice.h
gs/base/gxfapi.c
gs/base/gxfmap.h
gs/base/gximag3x.c
gs/base/gximage3.c
gs/base/gxline.h
gs/base/gxmatrix.h
gs/base/gxpath.c
gs/base/gxpath.h
gs/base/gxshade1.c
gs/base/gxshade4.h
gs/base/gxshade6.c
gs/base/gxtmap.h
gs/base/sdcparam.c
gs/base/spprint.c
gs/base/spprint.h
gs/base/stdpre.h
gs/contrib/eplaser/gdevescv.c
gs/contrib/eplaser/gdevescv.h
gs/contrib/lips4/gdevl4v.c
gs/contrib/opvp/gdevopvp.c
gs/devices/gdevcdj.c
gs/devices/gdevclj.c
gs/devices/gdevijs.c
gs/devices/gdevjpeg.c
gs/devices/gdevpxut.c
gs/devices/gdevpxut.h
gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfd.c
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfg.h
gs/devices/vector/gdevpdfj.c
gs/devices/vector/gdevpdfk.c
gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfo.c
gs/devices/vector/gdevpdfo.h
gs/devices/vector/gdevpdfv.c
gs/devices/vector/gdevpdts.c
gs/devices/vector/gdevpdts.h
gs/devices/vector/gdevps.c
gs/devices/vector/gdevpsdf.h
gs/devices/vector/gdevpsdi.c
gs/devices/vector/gdevpsdu.c
gs/devices/vector/gdevpsf2.c
gs/devices/vector/gdevpx.c
gs/devices/vector/gdevsvg.c
gs/devices/vector/gdevxps.c
gs/psi/idparam.c
gs/psi/idparam.h
gs/psi/imain.c
gs/psi/imain.h
gs/psi/zcolor.c
gs/psi/zgstate.c
gs/psi/zht1.c
gs/psi/zht2.c
gs/psi/zmatrix.c
gs/psi/zpath.c
gs/psi/zpath1.c
gs/psi/ztrans.c
pcl/pccsbase.c
pcl/pcfont.c
pcl/pcht.c
pcl/pcindxed.c
pcl/pcindxed.h
pcl/pcmtx3.c
pcl/pcmtx3.h
pcl/pcommand.c
pcl/pcpage.c
pcl/pcpalet.c
pcl/pcpalet.h
pcl/pcparam.h
pcl/pcpatxfm.c
pcl/pcpatxfm.h
pcl/pcrect.c
pcl/pcsfont.c
pcl/pctext.c
pcl/pgcolor.c
pcl/pgdraw.c
pcl/pgdraw.h
pcl/pgfdata.c
pcl/pggeom.c
pcl/pggeom.h
pcl/pglabel.c
pcl/pgpoly.c
pcl/pgvector.c
pcl/rtgmode.c
pcl/rtraster.c
pl/pjparse.c
pl/pjparse.h
pl/pjparsei.c
pl/pjtop.c
pl/pjtop.h
pl/plchar.c
pl/plfont.h
pl/plsrgb.c
pl/pluchar.c
pxl/pxink.c
pxl/pxpaint.c
pxl/pxpthr.c
svg/svgtop.c
tools/gslite/gslt_test.c
xps/xpstop.c


2013-12-18 11:37:40 +0000
Ken Sharp <ken.sharp@artifex.com>
5ddd13eda3853d53315b7ba656ccd32ad9814c34

ps2write - Don't emit a page size change if the last request failed (and was the same size)

Bug #694852 We check the current media size at the start of every page, and
only emit a new request if the page is a different size to the current size.

However, if the request fails (media not available) we keep on requesting
the media via setpagedevice. This causes duplexing to be disabled, as each
setpagedevice resets the device and ejects the previous page.

This commit still checks the current page size, however, if it is not the
size needed for the page, we then check to see if 'MediaRequested;' is
known. If it is not we set the media, and set MediaRequested to the new
media size. If MediaRequested is known, we check to see if the new media
size is the same as the last one we requested. If it is there's no point
in doing a new request as it will fail again,so we drop the request.

If the new requested media is not the same as the last requested media,
then we do emit a new request, which may or may not be satisfied of course.

This should permit duplexing to work and be slightly faster in the case
where requested media is not available.

gs/devices/vector/opdfread.h
gs/lib/opdfread.ps


2013-12-14 13:13:02 +0000
Chris Liddell <chris.liddell@artifex.com>
2f8b73d56d667334e935071f24f1d6b1860a48e2

Bug 694832: refine when to elide the TTF notdef glyph

Only force the Truetype notdef glyph to be non-marking when the font in
question uses a TTF cmap table other than the symbolic (3.0) cmap table.

Several cluster files show differences - all except one are progressions
with reference to Acrobat, and the exception was "wrong" before and is
slightly differently wrong now (an entirely different underlying issue).

gs/Resource/Init/gs_ttf.ps
gs/psi/zfapi.c


2013-12-17 17:33:05 +0000
Robin Watts <robin.watts@artifex.com>
727b6e87edc234670120dcce040547610736fe0d

Bug 694844: Fix thin stroking of paths with non-idempotent colors.

For non-idempotent colors when stroking we have to construct an entire
path and then fill it, rather than stroking each section as we go.

Unfortunately in the code that implements this, we missed a case - thin
sections can be stroked section by section even in the non-idempotent
case.

We fix that here.

This appears to solve Bug 694844, which was hitting this case.

gs/base/gxstroke.c


2013-12-16 18:13:03 +0000
Robin Watts <robin.watts@artifex.com>
300c3ea8f2c82471c5e57655bd13549f1172c38a

Bug 694842: Fix threshold table generation.

When we generate threshold tables for dithering, we should expect them
to be 'evenly distributed'. This is not the case currently. In the
example given in this bug, we generate an 8x4 dither table. This
contains 32 pixels, all of which can be on or off, hence we have 33
levels, ranging from 0 on to 32 on.

We would further expect our input range to be evenly divided into these
levels - i.e. roughly 256/33 in each band.

This is not the case. The threshold table generated is:

threshold array row 0= 88 120 152 184 176 144 112 80
threshold array row 1= 192 224 208 168 72 40 56 96
threshold array row 2= 232 255 240 136 32 8 24 128
threshold array row 3= 216 248 200 104 48 16 64 160

The operation of our thresholding code is to set a pixel if
contone(x,y) < threshold(x,y), hence our inputs divide into:
0-7,8-15,...240-254,255

Not only does this not have the required 256/33 per region, the top
and bottom regions are far from being even (8 vs 1 entries).

Ideally we should fix this code so generate the correct distribution -
an enhancement bug will be opened for this. For now we will satisfy
ourselves by offsetting the thresholds slightly so that the top and
bottom ranges are at least even. The new code gives:

threshold array row 0= 84 116 148 180 172 140 108 76
threshold array row 1= 188 220 204 164 68 36 52 92
threshold array row 2= 228 252 236 132 28 4 20 124
threshold array row 3= 212 244 196 100 44 12 60 156

gs/base/gsht.c


2013-12-17 10:30:26 +0000
Ken Sharp <ken.sharp@artifex.com>
712d2254dc190baeea795931a470d39f8d43c2bf

Update opdfread.ps with the changes for eps2write. Although we no longer
actually use opdfread.ps, instead we use opdfread.h, we want to keep the
two in sync.

gs/lib/opdfread.ps


2013-12-17 10:29:31 +0000
Ken Sharp <ken.sharp@artifex.com>
730dbe8b0717b2f882067163737eb89708e7e66d

correct a tab in the source, replacing with spaces.

gs/devices/vector/gdevpdfd.c


2013-12-16 17:44:22 +0000
Ken Sharp <ken.sharp@artifex.com>
1f30a9f66b280fad5cb8133e02530c60a038843c

Add new 'eps2write' device which will eventually replace epswrite

No differences expected

gs/devices/devs.mak
gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfd.c
gs/devices/vector/gdevpdfi.c
gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpdfx.h
gs/devices/vector/gdevpdtc.c
gs/devices/vector/gdevpdte.c
gs/devices/vector/gdevpdti.c
gs/devices/vector/gdevpdts.c
gs/devices/vector/gdevpdts.h
gs/devices/vector/gdevpdtt.c
gs/devices/vector/gdevpdtt.h
gs/devices/vector/opdfread.h
gs/psi/msvc.mak


2013-12-16 08:32:12 -0800
Michael Vrhel <michael.vrhel@artifex.com>
abd38464f9b058502c9491873ff7f01f00c406d7

Fix for goof up in loop index variable.

Fixes bug 694811 and 694848. Thanks ken for finding this.

gs/base/gdevp14.c


2013-12-16 12:34:26 +0000
Robin Watts <robin.watts@artifex.com>
8e2f00f15c988d75a4182ecdcdc1a82b4686ef92

Bug 694845: Shailesh Mistrys patch for regression in jbig2dec

Having reverted the problematic patch, this is the fixed version.

gs/jbig2dec/jbig2_symbol_dict.c


2013-12-16 11:45:42 +0000
Robin Watts <robin.watts@artifex.com>
fa8b62e45f07564304d671b57cba7fede5d4729d

Revert "Bug 694124: Shailesh Mistry's patch for valgrind problems."

This reverts commit d166833eb541466104c582980be1e42e0062c738.

gs/jbig2dec/jbig2_symbol_dict.c


2013-12-16 10:08:20 +0000
Chris Liddell <chris.liddell@artifex.com>
bcac8f9cfd8330ec4434b176c150c44af276393e

Force special action to build language_switch

A "normal" attempt to build language_switch will elicit a warning, to actually
make it build, adding "UNSUPPORTED=1" to the (n)make command line is required.

language_switch/pspcl6_gcc.mak
language_switch/pspcl6_msvc.mak


2013-12-15 09:51:50 -0800
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
88a39ea069424045161ff000af5574ba340bb51d

Remove the language switch build from the default make targets.

Makefile


2013-12-14 13:54:31 +0000
Chris Liddell <chris.liddell@artifex.com>
70c1f72389b31e95e9cffb6578a3a94e3052cb44

Bug 694843: reset FAPI font data on "refine" font

For example, a font dict may be copied, so the "FAPI" entry is copied with
the dict, but the new internal font object does not have the FAPI server in
it. We catch that in the "refine font" call - previously here we didn't reset
the font data, just "re-bound" the FAPI server. It turns out with the
language switch build, we need to set the FAPI font data, too.

No cluster differences.

gs/psi/zfapi.c


2013-12-13 15:15:24 +0000
Ken Sharp <ken.sharp@artifex.com>
5b592a88fa8760f5fd4d7a8f082e094bda981a93

pdfwrite - yet more discriminating tests before TrueType font combining

Bug #694833 "german letters adieresis, odieresis and udieresis are missing after conversion to PDF"

This follows on from commit 8b6be8be2cdcefae39339682d45d3c009ab909ac
Bug #694538.

Again we have a random pair of Type 42 fonts which would be compatible to
combine, except that they have differing max composite points and contours.
Mad, but there you go.

No differences expected, we don't see these files from any other source.

gs/base/gstype42.c
gs/base/gxfont42.h
gs/devices/gxfcopy.c


2013-12-12 16:20:59 +0000
Chris Liddell <chris.liddell@artifex.com>
3e8a32f8a884039b851c39b5aceabfd8c8e93198

Inherit CFLAGS from environment in (pdl) configure script

No cluster differences.

config.mak.in
configure.ac
main/pcl6_gcc.mak


2013-12-12 00:58:04 +0000
Robin Watts <robin.watts@artifex.com>
99a6f1af177c15f4db475186b79d169c993494ef

Bug 694119: Shailesh Mistry's patch for Valgrind problems.

Don't read off the end of an empty (or almost empty) buffer.

gs/openjpeg/libopenjpeg/t2.c


2013-12-11 19:06:03 +0000
Robin Watts <robin.watts@artifex.com>
bb123bf027bf7ea0aa5b82ed2626d21f91c57613

Bug 694363: Shailesh Mistry's patch for SEGV.

Avoid buffer overflow due to oversized image dimensions causing
int overflow.

gs/openjpeg/libopenjpeg/j2k.c


2013-12-11 19:02:39 +0000
Robin Watts <robin.watts@artifex.com>
d166833eb541466104c582980be1e42e0062c738

Bug 694124: Shailesh Mistry's patch for valgrind problems.

Detect zero sized symbol dictionary and exit neatly. Avoids overreads.

gs/jbig2dec/jbig2_symbol_dict.c


2013-12-11 09:47:45 -0800
Ray Johnston <ray.johnston@artifex.com>
f42c717329ec13db00f2627bd89ad4c081379fd9

Remove extraneous %d from a debug message (-ZL).

Thanks to Henry for spotting this.

gs/base/gxclutil.c


2013-12-11 16:17:31 +0000
Chris Liddell <chris.liddell@artifex.com>
19d709b45b9173e225bd6e62bb20e9eb5f192254

Bug 694836: remove erroring CIDFont subsitute record

When subsituting a CIDFont we dynamically update the CIDFont resource's .map
dictionary (to ensure the substitute CIDFont is loaded with the correct
"attributes").

If findresource fails with the updated .map dictionary, remove the entry we
just added, to avoid subsequent attempted loads of that CIDFont finding the
erroring .map entry.

No cluster differences.

gs/Resource/Init/gs_ciddc.ps
gs/Resource/Init/pdf_font.ps


2013-12-11 13:03:28 +0000
Ken Sharp <ken.sharp@artifex.com>
b3be65914d6dbe6585dec8576e80c7fb52fffbe4

pdfwrite - fix compiler comparison oddness

Bug #694838 "Artifex Ghostscript 9.10: JBIG2Encode requires CompabilityLevel >= 1.4"

The code compares a float variable with a non-integer constant. Bizzarely
the comparison fails unless the contant is declared as type float as well
(using the x.yf syntax), at least on the Microsoft compiler. Presumably
without this they are evaluated as double.

This commit simply alters the constants to be declared specifically as
floats.

No differences expected.

gs/devices/vector/gdevpdfp.c


2013-12-07 16:16:22 -0800
Ray Johnston <ray.johnston@artifex.com>
2aaae7404988d7443b002907954693749c468347

A better fix for the previous -dEPSFitPage.

Note that -dEPSCrop with -dEPSFitPage is actually done in the C
code.

gs/Resource/Init/gs_epsf.ps


2013-12-07 14:42:07 -0800
Ray Johnston <ray.johnston@artifex.com>
7f4d1c480eb53e2f18bd87a0c3cb0f98faa7281c

Fix EPSFitPage (related to bug 694829.

The EPSFitPage now rotates as well as translating/scaling.

gs/Resource/Init/gs_epsf.ps
gs/Resource/Init/gs_init.ps


2013-12-03 10:09:56 +0000
Ken Sharp <ken.sharp@artifex.com>
ca3d544d51c3e1d63a2fd115dac23255c966ba0e

pdfwrite - add Resources to current substream when starting an SP pdfmark

Bug #689653 "Nested form XObject pdfmarks not working properly"
Bug #689883 "/SP pdfmark inside /BP-/EP pdfmark pair for XObject re-use"

When we use a 'picture' via the SP pdfmark, add the picture resource to
the current substream resources, so that if we are accumulating a substream
(pattern, form, another picture etc) then the Resources for that substream
will contain an entry for the picture. Previously they did not and relied
on inheriting from the page dictionary, which is long since deprecated.

Thanks to Alexander Grahn for diagnosing the problem and supplying the
patch.

No differences expected.

gs/devices/vector/gdevpdfm.c


2013-12-02 16:28:46 -0800
Ray Johnston <ray.johnston@artifex.com>
da944b290302bf9391116b806c4a368b7d185d94

Add debugging for max heap memory allocation for -Z:

This is a minor hack for debug builds that prints out the 'max' usage
which is often of interest. A better method would be to add a memory
proc to print the stats that would be implemented for all allocators.

If so, a 'verbosity' control might be nice for 'max' (max used) and
'leaked' that would print all elements that the allocator knows about
(for leak detection), or 'current' to print current allocated size.

gs/psi/iapi.c


2013-11-30 13:46:49 +0000
Ken Sharp <ken.sharp@artifex.com>
05d2e5cd0b8ce92ddeacca00e8f64d3f7b2e5883

pdfwrite - add garbage collection handlers to Bicubic streams

Bug #694826 "Seg fault with pdfwrite device"

There was an oversight when coding the Bicubic stream downsampling and the
working buffer was not enabled for relocation on garbage collection.

No differences expected.

gs/devices/vector/gdevpsds.c
gs/devices/vector/gdevpsds.h


2013-11-29 09:31:04 +0000
Ken Sharp <ken.sharp@artifex.com>
33b41157c24f27cd912fa1d517e9246af37bbe2f

txtwrite - set the returned glpyh in the text enumerator before executing CDevProc

Bug #698422 "txtwriter driver crashes with this (badly crafted) PDF file"

The txtwrite device was leaving the 'returned' glyph unset when it needed
to run the CDevProc for a CIDFont. This could later cause a crash because
other code would attempt to use the uninitialised variable.

No differences expected.

gs/devices/vector/gdevtxtw.c


2013-11-28 18:24:03 +0000
Robin Watts <robin.watts@artifex.com>
748013087dd75882abbcfe4c630eeddb059be773

Bug 694362: More tweaking in jbig2dec.

Following more discussions with Simon, and testing within MuPDF, it
appears that the original code was correct. I am therefore restoring
the original behaviour, except with a direct jump to cleanup rather
than relying on dropping into the following case.

This will result in just 1 error being given, and is cleaner, to my
mind.

gs/jbig2dec/jbig2_symbol_dict.c


2013-11-28 17:51:02 +0000
Robin Watts <robin.watts@artifex.com>
fa25793292f8e6799ecad1bcd6565206b7566664

More work on bug 694362

Back out some 'unreachable code' that I had accidently added back in.

Remove a couple of unreachable 'break;' statements too.

gs/jbig2dec/jbig2.c
gs/jbig2dec/jbig2_segment.c
gs/jbig2dec/jbig2_symbol_dict.c


2013-11-28 16:43:26 +0000
Robin Watts <robin.watts@artifex.com>
e697fc428f4cca033d0b844cc4bceebffe50e853

Pull changes back from mupdf's version of jbig2dec to gs's.

MuPDF now tracks the version of jbig2dec extracted from gs.
Shelly spotted a couple of minor things that had been lost as
part of his investigation into bug 694362. Pull them back
across.

gs/jbig2dec/jbig2.c
gs/jbig2dec/jbig2_segment.c
gs/jbig2dec/jbig2_symbol_dict.c


2013-11-27 09:38:02 +0000
Ken Sharp <ken.sharp@artifex.com>
01cef1fd7dbaf3ef48dcff9e23875980265f2859

pdfwrite - ignore annotation /AP where the appearance is not a stream

Bug #694809 "Conversion of PDF-file fails with typecheck-error"

The speciment PDF file has an invalid appearance for an annotation:

182 0 obj
<<
/AP << /N << /Yes /null >> >>

The normal appearance should be a dictionary where each key value pair has
a value which is a stream. /null is not a stream.

This commit drops annotations with this problem and emits a warning.

No differences expected.

gs/Resource/Init/pdf_draw.ps


2013-11-27 10:44:28 +0100
Till Kamppeter <till.kamppeter@gmail.com>
87a7fd8afe9af506bf91024d8cc60ef0721450d5

"cups" output device: Support for PPD-less printing and PWG Raster output

1. PWG Raster output: With -sMediaClass=PwgRaster the output is in PWG
Raster format and not in CUPS Raster format. TODO: Create "pwg" or
"pwgraster" output device name for that.

2. Support for PPD-less printing: If the "PPD" environment variable is
not set to a valid PPD file, allow setting unprintable margins via
something like:

"-c '<</.HWMargins[12 12 12 12] /Margins[0 0]>>setpagedevice'"

3. Correct rounding by adding 0.5 to float numbers before converting
them to integer.

gs/cups/gdevcups.c


2013-11-27 08:43:53 +0000
Ken Sharp <ken.sharp@artifex.com>
49f620bbdabaa186b56cb783afd30bcfc8ca40ef

pdfwrite - remove an unused variable to silence a compiler warning

gs/devices/vector/gdevpdfv.c


2013-11-26 16:20:18 +0000
Ken Sharp <ken.sharp@artifex.com>
fe99ca5fd2e3b191a76c7f7d791b72f3603e9fea

pdfwrite - spot reuse of shading dictionaries and don't emit multiple times

Bug #689247 "pdfwrite creates redundant shadings"

Previously we always made a new shading and pattern dictionary every time
we encountered a shading. Taking advantage of the hashing mechanism that
was written to improve performance, we can now spot reuse of shading
dictionaries, and emit only a single copy.

The output from the test file now only contains 106 shadings and patterns
and the compressed file size is reduced by 41% as a result.

No differences expected.

gs/devices/vector/gdevpdfv.c


2013-11-26 09:21:13 +0000
Chris Liddell <chris.liddell@artifex.com>
fb3e5c6278fc7ea5e1bfdb3a23944cdcce13eb5a

Change the order of checks when enumerating PCL fonts.

We need to check whether the MT fonts have populated the font dictionary
before we worry about whether there's a path to find the TTF versions of the
built-in fonts.

No cluster differences.

pl/pllfont.c


2013-11-20 14:55:12 +0000
Chris Liddell <chris.liddell@artifex.com>
9ecb86e69f473d8c981baeca6885d67b23964440

pcl/FAPI MT font fixes.

Fix a problem with parsing out the FCO paths from the FCO list string (we could
run off the end of the string).

Make the "header" byte swapping call conditional on being a little-endian
platform.

Fix a makefile hiccup that resulted in the FCO files being built into the romfs
twice.

CLUSTER_UNTESTED

gs/base/fapiufst.c
main/pcl6_gcc.mak
pl/pllfont.c


2013-11-26 12:07:13 +0000
Ken Sharp <ken.sharp@artifex.com>
90ec17f20be53db00fcbc2ada6931e7cc7b22b9e

pdfwrite - fix dictionary stream hashing

The dictionary stream hashing code didn't initialise the MD5 hash before
using it, which could lead to problems. Also the cos_stream_equal routine
was passing in an MD5 state which would then be reused inside the hashing
code. Although this doesn't seem to cause a problem, and we don't actually
use that state, its safest if we make use a dummy instead.

Problems discovered while working on duplicate shadings.

No differences expected

gs/devices/vector/gdevpdfo.c


2013-11-25 18:26:20 +0000
Robin Watts <robin.watts@artifex.com>
83fb95771604bd85b1b3345f67d83cc99c69bfd9

Bug 694245: Fix valgrind problems.

During stroke calculations, ff we have a non-invertible matrix, then
use 0 as the calculated distance, rather than running with
undefined values. We were failing to check for an error code.

Returning an error code stops rendering, so swallow the error and
continue with 0.

gs/base/gxpdash.c
gs/base/gxstroke.c


2013-11-25 18:39:05 +0000
Robin Watts <robin.watts@artifex.com>
7be77f2a74952c2d7f8f3969ae885a014b51513c

Add missing Makefile header dependency.

gs/base/lib.mak


2013-11-25 09:58:08 -0800
Ray Johnston <ray.johnston@artifex.com>
0d8fcaef61f7af1a032f9dff8d38957b335ee8cc

Remove #define DEBUG_TRACE_PS_OPERATORS inadvertently left enabled.

gs/psi/iinit.c
gs/psi/iinit.h


2013-11-25 14:33:12 +0000
Robin Watts <robin.watts@artifex.com>
7b3a65aab20feac334cac8e5935ba5cbe310ac69

Fix previous commit; align_bitmap_mod is in bytes not bits.

Correct the calculations in the previous commit.

gs/base/gsiparam.h


2013-11-25 13:24:03 +0000
Robin Watts <robin.watts@artifex.com>
b81962611a292e1b2c5306f3d5cdfea832715169

Bug 694601: Fix big endian crash in mem_mono_copy_mono.

While the crash is reported on a big endian device, the problem actually
potentially occurs on little endian systems too. As it happens,
x86, amd64, and many ARM configurations will read happily from unaligned
addresses. Some ARMs and many other processors will not, however, so we
apply a fix that will work properly everywhere.

When calling device level functions, we should ensure that the 'raster'
given is always a multiple of align_bitmap_mod bits.

Thanks to John Wehle for the bug report and suggested fix.

gs/base/gsiparam.h


2013-11-23 21:37:03 -0800
Ray Johnston <ray.johnston@artifex.com>
4a72e695c6ad632a38d27eaaa45bdbad8b5a0fa1

Fix garbage output with --saved-pages due to not doing needed erasepage.

Actions which print, or reallocate to clist mode or page mode, may
need the page to be erased. This includes the 'print' action. Seen
with 12-07C.PS when gs_cet.ps is used.

Also, don't allow "copies n" without a prior "begin".

Silence a few build warnings (missing dependency)

gs/base/gxclpage.c
gs/base/gxclpage.h
gs/psi/iinit.h
gs/psi/imainarg.c
gs/psi/int.mak


2013-11-20 17:03:48 -0800
Ray Johnston <ray.johnston@artifex.com>
006051023733a636fc7e61754489e05fa38acdea

Remove FORCE_SAVED_PAGES_TEST since cluster now supports extras=...

Also clean up some compiler warnings.

gs/psi/imain.c
gs/psi/imainarg.c
gs/psi/iminst.h


2013-10-23 11:36:09 -0700
Ray Johnston <ray.johnston@artifex.com>
54610538e180cb5cb9b80c51f9a8a3d5b9bba5c2

Make order of --saved-pages-test and --saved-pages= options position independent.

The position of these command line options had been required to be the
last option prior to the first file to run, but this is not how most
other command line options operate. This allows the --saved-pages-test
or --saved-pages=begin option to be placed anywhere in the command line.

The debug option to FORCE_SAVED_PAGES_TEST is now in psi/imain.c
and the OMIT_SAVED_PAGES_TEST is removed.

gs/psi/imain.c
gs/psi/imainarg.c
gs/psi/iminst.h


2013-10-05 12:27:58 -0700
Ray Johnston <ray.johnston@artifex.com>
97535718d671b728c47f7bbc35512449c47d2bc1

Fix more Segfaults with --saved-pages and psdcmyk and many differences.

Devices that have devn paramaters could close the device so make sure
and open it. Also set banding_type to BandingAlways while in saved-pages
mode and restore it when we end saved-pages mode.

A few files still segfaulted, and there were many differences because
the page was not erased after the saved-pages "begin".

In gx_saved_page_load, for pages that fit in a single band (as with
large -dMaxBitmap values), reset the ymin and ymax to force rasterizing
the next page's clist.

gs/base/gxclpage.c
gs/base/gxclpage.h
gs/psi/imainarg.c
pl/plmain.c


2013-11-22 17:34:46 +0000
Chris Liddell <chris.liddell@artifex.com>
55d90681fd4eb85fa8d38b965fb31d12cdb133e2

Enable shared library builds on AIX (gcc only)

Add the code to detect AIX (and gcc), and setup the command like arguments
so the "make so" targets works.

There is still a "duplicate symbols" warning on ".main" when linking to the
shared lib - none of the documented options seemed to resolve that.

No cluster differences.

gs/configure.ac


2013-11-22 15:23:00 +0000
Ken Sharp <ken.sharp@artifex.com>
cdd142387a04a6d7ea519838e15204c4d7c681d8

pdfwrite - flush streams before attempting to MD5 hash them

This was discovered in the process of other work. Its possible that when we
MD5 hash a stream, its still partially or fully buffered, not written to
the asides file. This commit makes sure that the streams are flushed first.

No differences expected.

gs/devices/vector/gdevpdfo.c


2013-11-22 12:16:40 +0000
Robin Watts <robin.watts@artifex.com>
82e02b0dc49b51fbe4851a16a669ef83d35a2fae

Bug 694803: Fix truncated psd files.

GS can truncate the number of spots used if we are working with PDF
files, hence not all 6 planes may be written. Fix this here.

gs/devices/gdevcmykog.c


2013-11-22 14:09:34 +0000
Robin Watts <robin.watts@artifex.com>
47584728a68520b754ba97f0bcbf001a19d8271b

Bug 694802: psdcmykog files truncated on MacOS.

It appears that macos will not allow you to read from files opened
as "wb", so use "w+b" instead. I probably should have been using this
anyway.

gs/devices/gdevcmykog.c


2013-11-21 16:51:29 +0000
Robin Watts <robin.watts@artifex.com>
16c29cb9deb49be55c582213469ff6993d26c731

Bug 694798: Fix SEGV with psdcmykog device.

The alignment/padding code was going wrong. In cases where the device
changes size and reallocates, we were attempting to resize the buffer
memory using the aligned pointer rather than the unaligned pointer.

gs/base/gdevmem.c


2013-11-21 15:01:16 +0000
Robin Watts <robin.watts@artifex.com>
1829196ecccb692765c27c9b3eac13367cf50204

Bug 694797: Remove stray code from psdcmykog device.

Some stray code in the close method was causing the device to clear the
file on exit. This only seems to happen in some cases though. Just
removing the code should solve it.

gs/devices/gdevcmykog.c


2013-11-21 14:32:23 +0000
Ken Sharp <ken.sharp@artifex.com>
1eeb45d0537ba8e561f27d6461fc5b62bd042340

pdfwrite - honour device-independent color conversion strategy for images

Bug #694799 "New: incoherent output intent and color space in PDF/A (bis)"

The image colour conversion wasn't writing a device independent colour
space for UseDeviceIndependentColor or sRGB, but was instead writing
the original colour space.

No Differences expected.

gs/devices/vector/gdevpdfi.c


2013-11-20 12:46:01 +0000
Robin Watts <robin.watts@artifex.com>
8a94e4ee285f8b7d2f04edf2d8ac35f687355061

Remove boilerplate from gdevcmykog

gs/devices/gdevcmykog.c


2013-11-19 19:57:33 +0000
Robin Watts <robin.watts@artifex.com>
bbaff51c391f0e3e6c0503da9f355c96a739c1b4

Silence warning.

gs/devices/gdevpsd.c


2013-11-19 10:14:04 -0800
Ray Johnston <ray.johnston@artifex.com>
5af6431204f15f89519aac55c8d8ff42c823ced7

Fix misplelling of 'parent' in the gp files.

gs/base/gp.h
gs/base/gp_dosfs.c
gs/base/gp_macio.c
gs/base/gp_ntfs.c
gs/base/gp_os2fs.c
gs/base/gp_unifn.c
gs/base/gp_vms.c
gs/base/gpmisc.c


2013-11-19 19:18:50 +0000
Robin Watts <robin.watts@artifex.com>
ab73cd1550f558f5e1a82e60d95339b044713976

Solve psdcmykog hang on MacOSX.

Mac gets hung in the collating phase, presumably due to different
handling of eof conditions for read/write file handles.

Also, fix a mistake that can cause SEGVs in non debug versions.

gs/devices/gdevcmykog.c
gs/devices/gdevpsd.c


2013-11-19 17:03:27 +0000
Robin Watts <robin.watts@artifex.com>
9f03f419cc8cc598c2a9b4e94e41d6cfdad61c02

Various small fixes for psdcmykog build issues.

Rename the device. Include it in linux builds by default, along with
fpng.

Fix various warnings.

gs/Makefile.in
gs/base/gdevdevnprn.h
gs/base/lib.mak
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/configure.ac
gs/devices/devs.mak
gs/devices/gdevcmykog.c
gs/devices/gdevfpng.c
gs/psi/msvc.mak


2013-11-15 18:30:21 +0000
Robin Watts <robin.watts@artifex.com>
3cee4eb9e3c24e0a2e7c48fddc473590c5a820b6

Make garbage collector private.

Private is better than public.

gs/base/gsgcache.c


2013-11-18 16:20:05 +0000
Robin Watts <robin.watts@artifex.com>
be1e5a0dde242dc41f4e67a629d6bf403ac2938b

Update psdcmykog to use common psd writing functions.

gs/devices/gdevcmykog.c


2013-11-15 17:24:04 +0000
Robin Watts <robin.watts@artifex.com>
bf2404a47b8b2843e37efbb0d242e5b46357b588

Tweak psdcmykog.c to use gdevdevnprn.h functions.

This reduces the boilerplate.

gs/devices/gdevcmykog.c


2013-11-06 17:52:25 +0000
Robin Watts <robin.watts@artifex.com>
8cb60cfe03ab7f1ada9b26eb57342fa9eca62e48

psdcmykog: simple example process_page device

This device demonstrates a range of facilities newly added to
the Ghostscript core. This device exists as an exemplar for these
facilities, and as a mechanism to allow us to cluster test.

gs/devices/devs.mak
gs/devices/gdevcmykog.c
gs/ghostscript.vcproj
gs/psi/msvc.mak


2013-11-18 16:19:12 +0000
Robin Watts <robin.watts@artifex.com>
7089d5416766a4a526b382e57e4436633d29bb9e

Externalise psd writing functions.

This will enable psdcmykog to share the psd writing functions.

gs/base/gdevdevnprn.h
gs/devices/gdevpsd.c


2013-11-15 17:14:14 +0000
Robin Watts <robin.watts@artifex.com>
a1bee59ddf2bf82273359564d6cdb8e0549ae14f

Extract guts of spotcmyk device to be reusable.

Whenever we build a "devicen" based device, there is a lot of repeated
code. Tweak the spotcmyk functions (one such device) into a form where
they can be reused more easily.

Also add cmyk_equiv_colors into this extracted structure. This shouldn't
matter to code that doesn't use the equivalent colors, (i.e. spotcmyk
and devicen will be unaffected), but should allow us to bring the psd
devices into the fold.

gs/base/gdevdevn.c
gs/base/gdevdevnprn.h
gs/base/lib.mak
gs/devices/gdevpsd.c
gs/ghostscript.vcproj


2013-11-18 15:43:32 +0000
Ken Sharp <ken.sharp@artifex.com>
a65b8db506a553334de495a9b27a18811188539a

pdfwrite - new colour code, emit sRGB as ICCBased

Bug #694780 "incoherent output intent and color space in PDF/A"

sRGB was supposed to be written as ICCBased, but the code has a special
check to see if the ICC profile being used is one of the default ones
(ie its our ICC equivalent of Gray, RGB or CMYK) and if it is, we write
the original colour apace out.

Added a boolean to override this behaviour so that when we emit sRGB we do
in fact write the ICCBased equivalent profile for RGB.

No differences expected.

gs/devices/vector/gdevpdfb.c
gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfg.h
gs/devices/vector/gdevpdfi.c
gs/devices/vector/gdevpdfk.c
gs/devices/vector/gdevpdft.c
gs/devices/vector/gdevpdfv.c


2013-11-15 13:21:42 +0000
Ken Sharp <ken.sharp@artifex.com>
d2804d480928140577560f673eb6a6419afb9abd

AES decryption - Don't return an error if the input is not a multiple of 16 bytes

Bug #694781 "Regression: error reading PDF files starting with 4885eb2fa363002fdf0980cd189f2a5bb9340f58"

The stream is technically invalid, it should be a multiple of 16 bytes in
length. Acrobat as usual silently ignores the error.

We now emit a warning but carry on.


No differences expected

gs/base/saes.c


2013-11-07 12:36:18 -0800
Ray Johnston <ray.johnston@artifex.com>
b83ce7db814dd026b97bf2e00429459fc9c1f296

Improve collection of color_usage.or bits and track devn colors.

Some of this was in place with cmd_drawing_color_usage, but it was
not used many times, and it just returned 'all'. Also, add the
check for devn colors that are widely used with planar devices
such as psdcmyk.

Also handle the color_usage_array in the setup and teardown of the
BGPrint thread and/or multiple rendering threads.

gs/base/gxclimag.c
gs/base/gxclpath.c
gs/base/gxclrect.c
gs/base/gxclthrd.c


2013-11-14 12:11:02 -0800
Ray Johnston <ray.johnston@artifex.com>
db89e2390033fde0c69ffc01aeff346296336907

Fix SEGV with BGPrint=true -dNumRenderingThreads=2

With BGPrint=true, the icc_cache_list for the rendering threads was
allocated using 'mem', but was being freed using mem->thread_safe_memory.
The BGPrint clist device 'mem' is a chunk allocator but its thread
safe memory is the heap allocator.

gs/base/gxclthrd.c


2013-11-14 17:02:27 +0000
Robin Watts <robin.watts@artifex.com>
026a7ed96060a9f9a11a16857a9549f77ed5042b

Fix alignment of memory buffers in page mode.

The setup buffer call was setting the 'base' member to it's aligned
version, and the caller was then overwriting it with the unaligned
version. Simply remove the override.

gs/base/gdevprn.c


2013-11-14 14:02:05 +0000
Robin Watts <robin.watts@artifex.com>
10b2168ba0a3973ce1e98b8405e01bc7d235464d

Correct raster calculation in get_bits_rectangle for planar case.

gs/base/gdevdgbr.c


2013-11-13 09:29:55 -0800
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
ea5452061ce70ada597888e629e6f6e9ca09ab10

Fix building WIN64=1 with Visual Studio 2013 and add pam to default devices.

gs/psi/msvc.mak


2013-11-13 16:57:46 +0000
Robin Watts <robin.watts@artifex.com>
428f750746c09af66e53eed08a9fabf8dba2fef8

Bug694768: Fix VMerrors during pattern processing.

In a recent commit I moved the line_ptrs into the clist data block.
Don't do this for pattern accumulator operation, as the logic is
different.

gs/base/gxclist.c
gs/base/gxclread.c
gs/base/gxclthrd.c


2013-11-13 15:38:45 +0000
Robin Watts <robin.watts@artifex.com>
d42c77506452de368bebb64e61fd5f0b7347b343

Fix SEGVs caused by icc_cache_cl memory space change.

A few commits ago, we moved the icc_cache_cl used for NRT > 0 to the
thread safe memory handler. This meant it was no longer in gc-able
space, so we therefore removed the enumeration of icc_cache_cl from
the clist structure definitions.

Unfortunately I forgot to move the non-NPR related allocations of
icc_cache_cl to the same thread safe handler, meaning that they were
still being allocated in gc-able memory and causing crashes. For
example:

gs/debugbin/gswin32c.exe -Z@ -o out.pbm -sDEVICE=ppmraw -r300
-dMaxBitmap=400000000 ../ghostpcl/tests_private/comparefiles/Bug690189c.pdf

gs/base/gxclist.c
gs/base/gxclpage.c
gs/base/gxclthrd.c
gs/base/gxp1fill.c
gs/base/gxpcmap.c


2013-11-13 14:03:30 +0000
Robin Watts <robin.watts@artifex.com>
0c50e7ba960e2ed37deb87501d8b966e5d800cd8

Fix crash with NPR > 0 and planar devices.

A command such as:

gs -sDEVICE=psdcmyk -r300 -dMaxBitmap=10000 -dNumRenderingThreads=3
gs/examples/tiger.eps

would crash with a SEGV due to an incorrect calculation for raster in
get_bits_rectangle.

clustercmd
clusterdatestamp
gs/base/gxclthrd.c


2013-11-13 13:35:56 +0000
Ken Sharp <ken.sharp@artifex.com>
f221142fa36adc5a3d1192e534196dd4a7e953b4

PDF interpreter - more heuristics to work around broken PDF files

Bug #594772 " Regression: missing data reading PDF files starting with d5c42d3a14cee808fd889c14805a69adae8eb5b9"

The PDF file is broken, it has a font with a FontMatrix where one of
the values is 0.-4.

Previously we used .pdftokenerror which would detect
this and convert the value to 0 (observed Acrobat behaviour). However at
some point this was modified so that if we are not in a content stream we
convert into a name object instead.

This doesn't work in the case of a matrix. Unfortunately changing it back
broke *many* PDF files. Almost all of them from SumatraPDF and they are
also badly broken but still....

In essence we want to treat broken numbers as '0' and broken anything else
as a name. So the code now tries to decide if the input looks like a broken
number (contains 0-9, ',', '.' or '-' and nothing else). If it looks like a
number we pass it through .pdftokenerror which will convert it to 0. It is
possible for .pdftokenerror to throw an error, though, so we run it in a
stopped context and if it does, we convert to a name instead. If it doesn't
look like a number, we just convert it to a name.

This causes differences in Bug694429.pdf, but the differences are that more
text is now drawn. The output was wrong before, its wrong now, its merely
wrong in a different way.

gs/Resource/Init/pdf_base.ps


2013-11-12 16:19:46 -0700
Henry Stiles <henry.stiles@artifex.com>
4d3dc3a3a6948a49a2e8faed57290da40a774703

Fix 694773 - default raster resolution to the PJL setting when in
HPGL/RTL mode.

pcl/rtgmode.c


2013-11-11 19:07:09 +0000
Robin Watts <robin.watts@artifex.com>
a0a9d6746cf2e911c2db54c756e34e9e52c0723a

Introduce a list of device caches within the clist.

This is only used when NumRenderingThreads > 0, and avoids us recreating
caches every page.

We allocate the cache list with the thread safe allocator. This has the
effect of moving the icc_cache_cl entries out of the thread specific
chunked allocators, and also out of garbage collected memory. We
therefore remove the code to enumerate icc_cache_cl.

Also, this has the effect of fixing a gc enumeration bug where the first
element of the imager state wouldn't have been enumerated.

gs/base/gdevprn.c
gs/base/gxclist.c
gs/base/gxclist.h
gs/base/gxclthrd.c
gs/base/gxclthrd.h


2013-11-12 17:26:13 +0000
Robin Watts <robin.watts@artifex.com>
482b8b302399afda3b14242c56209a76694e0062

Fix reference counting for icc_cache_cl in clist.

Currently we only rc_decrement the icc_cache_cl entry in the bg_print
case. We should really be decrementing in all cases, but we get away
with this because the icc_cache_cl entries are allocated in the
rendering threads own chunked allocator which is destroyed after each
run.

In a soon-to-come commit, icc_cache_cl will be moved out of the
thread specific chunked allocator, and these will become real leaks.

The simple fix is to rc_decrement in all cases.

gs/base/gxclthrd.c


2013-11-12 18:31:50 +0000
Robin Watts <robin.watts@artifex.com>
a0386e872771958c67874ab4ef45eb8f43c63f77

Add 'extras' option to clusterpush.pl

Use:

clusterpush.pl gs lowres extras=-dNumRenderingThreads=3

to specify extra args to supply to all jobs.

clustercmd
clusterdatestamp
gs/toolbin/localcluster/clusterpush.pl


2013-11-11 19:06:41 +0000
Robin Watts <robin.watts@artifex.com>
6d4dc3c736c4cdf9e1728484857c613baf6ba3b4

Silence build warning.

Downcast to the basic device.

gs/devices/gdevfpng.c


2013-11-12 10:33:42 +0000
Chris Liddell <chris.liddell@artifex.com>
f15da3a62aed425e85597b8482daf7ff778beb31

GS_THREADSAFE: don't ignore "basic" fills....

In the default "fill" device method, don't drop the call to
gx_general_fill_path() for the GS_THREADSAFE build.

No cluster differences.

gs/base/gxfill.c


2013-11-11 16:56:11 +0000
Ken Sharp <ken.sharp@artifex.com>
bcb467c754a7a292f2ed65e61953782577e0412d

pdfwrite - set CIDToGIDMap correctly for PDF/A-2 output

Bug #694769 "Fonts changed from TrueType to CID TrueType and not displaying correctly in output PDF"

We opted not to emit CIDSet for PDF/A-2 since its now documented as
optional and I wasn't able to find a CIDSet which would pass Acrobat's
preflight tool.

However, the code also skipped the correct setup of the CIDToGIDMap and we
can't do that or the output will be incorrect.

This commit makes PDF/A-1 and PDF/A-2 behave the same with respect to the
CIDToGIDMap.

No differences expected, we don't test PDF/A production

gs/devices/vector/gdevpdtd.c


2013-11-11 10:42:06 +0000
Chris Liddell <chris.liddell@artifex.com>
f9774c5ae1b9cb12a811d810787b3e21d001a08f

Bug 694767: have configure set some Trio flags.

For systems that lack some math functions.

No cluster differences.

config.mak.in
configure.ac
gs/Makefile.in
gs/configure.ac


2013-11-11 16:14:21 +0000
Chris Liddell <chris.liddell@artifex.com>
efc0ab29473b65f1f0a119023601d987921373c0

Bug 691498: only declare Windows DLL exports once.

Using both the __declspec(dllexport) form *and* the .def file results in export
symbols being declared twice, and warning from the linker (but only on x86_64
for unknown reasons!).

See: http://support.microsoft.com/kb/835326

The original uses of __declspec(dllexport) are left in place, but conditionally
compiled out, just in case.

CLUSTER_UNTESTED

gs/base/gs_dll_call.h
gs/psi/iapi.h


2013-11-11 12:41:02 +0000
Alan Hourihane <alanh@fairlite.co.uk>
48a0dd978939fb6ae7bd445fd7b07bcf3b918948

Bug 694766: rename "internal" SHA symbols

Prevent linker errors when linking to something else that uses SHA, by
prepending "p" (for private) to our "internal" SHA symbols.

gs/base/sha2.c
gs/base/sha2.h


2013-11-11 09:07:07 +0000
Ken Sharp <ken.sharp@artifex.com>
c6d592ef12079f3a1ea7b9218620f813769c3654

pdfwrite - when unable to convert a Shading colour space, fallback to image

Bug #688731 "Huge PDF file with ProcessColorModel=/DeviceCMYK and ColorConversionStrategy=/CMYK"

When we can't convert the colour space of a shading dictioanary to satisfy
the ColorConversionStrategy we currently fall back to the rendering method
used by gx_fill_default, which is to degenerate into parallelograms.

This results in hugs and very slow PDF files.

This commit tests the ColorConversionStrategy when we detect an inability
to include a Shading unchanged, and if the strategy is not 'LeaveCOlorUnchanged'
then we use the ps2write approach and render the shading to an image instead.

This produces smaller faster output and the quality can be controlled by
setting resolution with the -r switch allowing a tradeoff between size and
quality.

If we should be unable to embed a shading for other reasons we will still
fall back to the parallelograms method. We may want to avoid this in all
circumstances, but lets wait for an example before we decide.

No differences expected.

gs/devices/vector/gdevpdfd.c


2013-11-08 18:33:23 +0000
Robin Watts <robin.watts@artifex.com>
db8fcdf94105c55a8886203254e401b601f29a69

Remove dev->num_planes in favour of dev->is_planar.

This removes the need to remember to keep
dev->num_planes == dev->color_info.num_components for all planar
devices.

gs/base/gdevdevn.c
gs/base/gdevdrop.c
gs/base/gdevmem.c
gs/base/gdevmpla.c
gs/base/gdevp14.c
gs/base/gdevppla.c
gs/base/gdevprn.c
gs/base/gsdevice.c
gs/base/gsovrc.c
gs/base/gxclimag.c
gs/base/gxclip.c
gs/base/gxclist.c
gs/base/gxclist.h
gs/base/gxclthrd.c
gs/base/gxdevcli.h
gs/base/gxht_thresh.c
gs/base/gxicolor.c
gs/base/gximono.c
gs/base/gxp1fill.c
gs/base/gxpcmap.c
gs/devices/gdevplib.c


2013-11-08 16:40:10 +0000
Robin Watts <robin.watts@artifex.com>
c0e10e8636386abf427f922390445b0b6cb2bb59

Fix SEGV in psdcmyk.

tests_private/pdf/sumatra/586_-_missing_images_gs_SMask_not_applied.pdf.psdcmyk.300.1

It seems num_planes was getting out of sync with color_info.num_components.

gs/base/gdevp14.c


2013-11-08 17:55:04 +0000
Ken Sharp <ken.sharp@artifex.com>
1cb2458772321dc86117cb45b5b28a1423ccf9b7

pdfwrite - free any allocated memory when initialising stream filters

Bug #694758 "Segmentation Fault"

It seems that the arcane image setup sequence used by pdfwrite can result
in us calling stream 'init' functions more than once for the same stream.
Some of the stream filters (Average and Bicubic) allocate some working
memory in the 'init' procedure, but they don't check to see if the
working memory has already been allocated.

This is primarily a cause of memory leaks, though since the memory is
garbage collected it won't (probably) actually leak. However it *does*
seem to confuse the garbage collector when relocating the stream state
structure. We allocate a buffer 9.9Kb but when we come to use it it has
shrunk to a little over 1Kb.

This commit checks the working memory and if its not NULL then we free it
before re-allocating (we might be re-initialising to a different size) which
resolves the problem for me. However because it changes the memory pattern
its possible this is simply masking the problem. Note that this change
assumes that the structure members will be set to NULL when the structure
is allocated (which it always is at the moment).

No differences expected

gs/devices/vector/gdevpsds.c


2013-11-08 16:08:41 +0000
Chris Liddell <chris.liddell@artifex.com>
656f26c232933c6b3c29d2e6b37574096572f35a

Bug 694622: address a compiler warning.

Use sprintf() instead of gs_sprintf() for "top level" code.

CLUSTER_UNTESTED

gs/psi/dxmain.c


2013-11-08 09:52:25 +0000
Chris Liddell <chris.liddell@artifex.com>
8f2a046ddc81258749e73cfc7a6daf0a43488181

Bug 694624: remove couple of deprecated filters.

Remove the Bounded Huffman and Burrows-Wheeler filters: not required by any
of the interpreters, and not used anywhere else.

No cluster differences.

gs/base/sbhc.c
gs/base/sbhc.h
gs/base/sbwbs.c
gs/base/sbwbs.h
gs/base/shcgen.c
gs/base/shcgen.h
gs/doc/Develop.htm
gs/psi/int.mak
gs/psi/zfilterx.c


2013-11-08 13:26:29 +0000
Robin Watts <robin.watts@artifex.com>
a9567942aa10ef2321627316d6f647819584179d

Solve SEGV due to recentl planar changes.

tests_private/comparefiles/Bug692217.pdf.psdcmyk.72.0 would SEGV.

This was because num_planes was getting out of sync with num_components.

gs/base/gdevp14.c


2013-11-07 17:30:06 +0000
Chris Liddell <chris.liddell@artifex.com>
f59dba325a55dd25ad6b5af4f9579b21bd562eb2

Bug 690878: have ghostpdl use HAVE_FILE64 setting

The GhostPDL configure checked for, but the config.mak.in never used the setting
for HAVE_FILE64.

Add it in.

No cluster differences.

config.mak.in


2013-11-07 17:21:27 +0000
Chris Liddell <chris.liddell@artifex.com>
31120fdcbb3f1ab815ade3763b638b77bd9b3d76

Bug 690776: missing check for HAVE_MKSTEMP64

Oddly, the ghostpdl configure.ac checked for mkstemp64 but config.mak.in did not
have the substitution pattern for the -DHAVE_MKSTEMP64.

So add that in.

No cluster differences.

config.mak.in


2013-11-07 15:37:37 +0000
Dr. Werner Fink <werner@suse.de>
4a4a912b43ae85b8c3d07f6d4727ced14b2e102a

Bug 690571: deal with memory dev/xdev dimensions being different.

For GV (and ghostview) a memory deivce is used. The problem is now
that most time the width and height of the memory device is not
identical with the xdev device its self. Also extrem large bbox
can lead to problems on systems with less physical memory.

This patch avoids these two problems.

No cluster differences.

gs/devices/gdevx.c


2013-11-07 20:12:14 +0000
Robin Watts <robin.watts@artifex.com>
c4357befbf3d09c50c4208bbb5dd9864269bf9b3

Fix previous tweak to clist line_ptrs.

The calculation for the clist line_ptrs used before was broken; I guess
this proves that we weren't relying on it in most cases. This solves
a few SEGVs.

gs/base/gdevppla.c
gs/base/gxclread.c
gs/base/gxclthrd.c


2013-11-07 18:29:46 +0000
Robin Watts <robin.watts@artifex.com>
64a57147f683bfbf4c9f2bfcd978e8bcbd87ad97

Fix SEGV in psdcmyk cluster tests.

tests_private/comparefiles/09_47N.PDF.300.1 SEGVs due to typo in
gx_forward_strip_tile_rect_devn.

gs/base/gdevnfwd.c


2013-11-07 09:49:47 -0800
Ray Johnston <ray.johnston@artifex.com>
1805749a2338844f19a3c7d336fd4707d04b13de

Fix fpng crash, file has_transparency

In clist_playback_band, it checks to see if there is a compositor as
the target, and needs to free it, but it should not close the device
if its is_open is false, since that would forward the close to the
orig_target, closing the memory device. The pdf14 pop_device had
already done the pdf14_close and set the procs to forward.

gs/base/gxclrast.c


2013-11-07 17:23:40 +0000
Robin Watts <robin.watts@artifex.com>
6efb9ed5890e7b56814699f6e374de97602a0a1b

Squash some warnings.

gs/base/gdevmem.c
gs/base/gdevmpla.c
gs/base/gdevp14.c
gs/base/gdevppla.c
gs/base/gsicc_manage.c
gs/base/gsicc_nocm.c
gs/base/gxccman.c
gs/base/gxclthrd.c
gs/base/gximage3.c
gs/base/gxpcmap.c
gs/devices/gdevpsd.c
gs/devices/vector/gdevpdfd.c


2013-11-07 15:47:19 +0000
Robin Watts <robin.watts@artifex.com>
432f71e687183df4971c0bee1932fb57ef0295a1

Tweak clist line_ptrs data.

The clist has always allocated space for the memory device as if
the line_ptrs were to be included within the allocated space, but
has never actually put the line_ptrs into this space.

Consequently the memory device always allocates space for the
line_ptrs itself. This space is then freed on a close_device call.

This can present problems in NumRenderingThreads mode, when
process_page is used. With the existing code, within clist_render_thread,
the buffer device is setup (and the new line_ptrs block is allocated).
The device is then freed at the end of clist_playback_band
(called from clust_render_rectangle). This nukes the line_ptrs
leaving the get_bits_rectangle call from within the process_fn call
to fail when dereferencing NULL.

The fix here is to amend the clist device structure to include the
offset within the block that the line_ptrs should be allocated at.
This offset can then be used to pass in the address of the line_ptrs
to the setup_buffer_device call. This means the line_ptrs survive
device closing.

This still leaves questions (in my mind at least) as to whether the
handling of the device closures within clist_playback_band is correct
or not.

gs/base/gxband.h
gs/base/gxclist.c
gs/base/gxclthrd.c


2013-11-07 10:37:34 +0000
Ken Sharp <ken.sharp@artifex.com>
cfeb9f98b896384ac366f4e30f3653a52de7af87

pdfwrite - add a Resources dictionary to 'Group' dictionaries

Bug #693322 "Acrobat Preflight tool reports missing XObjects"

Crazy Cairo-constructed files can result in Group dictionaries which use
other resources (in this case an ExtGState) and this wasn't possible in
the existing code. This commit adds a Resources dictionary so that it is
now possible to recreate this.

No differences expected

gs/devices/vector/gdevpdft.c


2013-11-07 09:15:38 +0000
Chris Liddell <chris.liddell@artifex.com>
6c5ecdf1a54e9d5a572c11860492abce06523f24

Bug 694718: "reset" MT fonts for each glyph.

Seems some vesions of UFST require the font object to be recreated for each
glyph to work correctly. So when I fixed the optimisation in gxfapi.c to
avoid calling "get_scaled_font()" when the font parameters had not changed, it
exposed the problem with the UFST integration.

To address this, the fapi/ufst code now zeros out the stored scale matrix for
MT fonts, so the code in gxfapi.c always registers the scaling as having
changed. Luckily, recreating the MT font object is not a very expensive
operation.

Also, grab the design units scale from the UFST state structure if the values
haven't been set in the outline structure.

CLUSTER_UNTESTED

gs/base/fapiufst.c


2013-11-07 08:27:47 +0000
Ken Sharp <ken.sharp@artifex.com>
58cdefdeadbceda4833e489b6d94f5895a2d8ea4

pdfwrite - check a return code

Silences a compiler warning (and is the right thing to do of course)

gs/devices/vector/gdevpdft.c


2013-11-06 09:18:19 +0000
Ken Sharp <ken.sharp@artifex.com>
616ff4cc44b00bcf7df97b64c8bdaebbe0620713

pdfwrite - add transparency Group to substream resources

Bug #691352 "cairo pdf mis-distilled."

This fixes the last remaining problem with this old bug. When we were
creating Form XObjects (because of transparency groups) we were assuming
that the from was a child of the page.

However, groups nested within groups (uncommon, except with Cairo's awful
output) can cause a Form XObject to have children which are also Form
XObjects. In this case we need to have the Form (or other substream) add
the child form to its own Resources rather than inheriting them from the
Page.

This also addresses (most of) Bug #693332 though this still leaves a
dangling ExtGState which needs separate investigation.

No Differences expected

gs/devices/vector/gdevpdft.c


2013-11-04 18:32:21 +0000
Robin Watts <robin.watts@artifex.com>
29a06fed84063976abe9864659384e7e371d799e

Add alignment and padding code.

Every time we create a new device in the code, we need to copy
the pad and align values from the 'base' device to the new device.

Build with TEST_PAD_AND_ALIGN defined to force on for pxmraw and psdcmyk.

gs/base/gdevdevn.c
gs/base/gdevmem.c
gs/base/gdevmpla.c
gs/base/gdevppla.c
gs/base/gdevprn.c
gs/base/gxbitmap.h
gs/base/gxclthrd.c
gs/devices/gdevpbm.c
gs/devices/gdevpsd.c


2013-11-01 17:30:00 +0000
Robin Watts <robin.watts@artifex.com>
b3aec5521e0e5d84164285353af20a5163139c3f

Remove is_native_planar.

gs/base/gdevdevn.c
gs/base/gdevdflt.c
gs/base/gdevdrop.c
gs/base/gdevmem.c
gs/base/gdevmpla.c
gs/base/gdevnfwd.c
gs/base/gdevp14.c
gs/base/gdevppla.c
gs/base/gsdevice.c
gs/base/gsovrc.c
gs/base/gxccman.c
gs/base/gxclimag.c
gs/base/gxclip.c
gs/base/gxclist.c
gs/base/gxclrect.c
gs/base/gxdevsop.h
gs/base/gxht_thresh.c
gs/base/gxicolor.c
gs/base/gximage3.c
gs/base/gximono.c
gs/base/gxp1fill.c
gs/base/gxpcmap.c
gs/devices/vector/gdevpdfd.c


2013-11-01 16:47:06 +0000
Robin Watts <robin.watts@artifex.com>
f6946de99dd19c7a883d7edb28b4f52290e3e934

Steps towards supporting aligned and padded buffer devices.

Introduce log2_align_mod, pad and num_planes to the gx_device
structure. Values of 0 will cause no changes to default behaviours.

gs/base/gdevppla.c
gs/base/gdevprn.c
gs/base/gsdevice.c
gs/base/gxclread.c
gs/base/gxdevcli.h
gs/base/gxdevice.h
gs/base/gxdevmem.h
gs/devices/gdevbit.c
gs/devices/gdevplib.c


2013-11-04 17:23:28 +0000
Ken Sharp <ken.sharp@artifex.com>
a8f9934aa6c54830230f749280765ea4e65471d2

pdfwrite - fix some XML emission

Bug #694736 "PDF/A XMP dc:description - wrong element structure"

The dc:creator is specified as a text sequence, but we were also emitting
the dc:description that way, which is clearly wrong.

gs/devices/vector/gdevpdfe.c


2013-11-04 15:09:03 +0000
Ken Sharp <ken.sharp@artifex.com>
f09f7f7cd37f3a52f733019e1d383034dd1c01cf

pdfwrite - revert a4de55 and check for parentheses properly instead

Bug #694735 "PDF/A XMP metadata and DOCINFO synchronization"

The commit a4de55 was incorrect, the PDF/A spec clearly states that the
XML creator is based on the Author. However, when an empty string is
present for the Document Info entry, we should not write the string parentheses
into the XML, this is clearly incorrect.


Still no differences expected.

gs/devices/vector/gdevpdfe.c


2013-11-04 13:41:00 +0000
Ken Sharp <ken.sharp@artifex.com>
a4de55d2fd0fa38e5110e7b5d5cca746528b28f6

pdfwrite - use /Creator instead of /Author for the XML creator entry

Bug #694735 "PDF/A XMP metadata and DOCINFO synchronization"

We were using the Document Info /Author field for the XML 'creator' which
apparently causes at least one PDF/A validator to take offence. Its not
entirely clear to me from the documentation which one is inteded to be
here, so we'll just use /Creator instead.

No differences expected.

gs/devices/vector/gdevpdfe.c


2013-11-04 09:26:47 +0000
Ken Sharp <ken.sharp@artifex.com>
ee0bf17f4912f131f7ad98aab744e571a18ece39

pdfwrite/ps2write colour management, enable the new code

Change the default setting of teh colour management switch so that we
default to using the new code.

If we are creating PDF/A-1, force the old colour management, we can't yet
guarantee that we are getting a version 2 profile.

Add some minimal documentation in ps2pdf.htm, hopefully we will do some
more work in this area before release, and the documentation can be revamped.

This change results in a lot of differences, especially with ps2write. In
the main these are slight shifts in color values caused by using a different
(better) conversion system. However, the new code does a much better job
of handling some kinds of colour spaces, in particular Separation spaces
with ps2write which are now preserved. This leads to a number of progressions
in the test suite.

I've looked at all the differences and I believe they are all either very
minor colour shifts, or progressions.

This is with 'LeaveColorUnchanged', actually converting to different spaces
does result in differences but this can't be cluster tested. I believe these
are all progressions however.

gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfp.c
gs/doc/Ps2pdf.htm


2013-11-02 12:21:21 +0000
Ken Sharp <ken.sharp@artifex.com>
41e1bdc7ef06bd00874890b36a53d84166ef30d0

pdfwrite - colour code, do not apply range limiting for images

When handling an image in a Lab space, do not reset the range of the space.
We don't need to when preserving an image, and if we use the same space
immediately afterward for linework, the range clamping causes the components
to come out black.

No differences, code is not used yet.

gs/devices/vector/gdevpdfi.c


2013-11-02 12:19:03 +0000
Ken Sharp <ken.sharp@artifex.com>
eada430a0c612f5f50a9fea6416daa048464a5c3

pdfwrite - coiour code, silence some compiler warnings

gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpsdu.c


2013-11-01 11:01:02 -0700
Ray Johnston <ray.johnston@artifex.com>
82bfa31f2f423223b002aab74323927e8ee42ea0

Add in some missing checks for failed allocations in gsicc code.

There are a couple of functions that are 'void' that just return,
which seems like should be fixed. Also fix _cmsCalloc in gsicc_lcms.c
to actually clear the memory.

gs/base/gsicc_cache.c
gs/base/gsicc_lcms.c
gs/base/gsicc_manage.c
gs/base/gsicc_nocm.c
gs/base/gsicc_profilecache.c
gs/base/gsicc_replacecm.c


2013-11-01 08:32:45 +0000
Ken Sharp <ken.sharp@artifex.com>
b937b04503837d2ac6f3877478b5500f4bc8ea8a

pdfwrite/ps2write - colour code work

1) Rescale inputs to 0->1 before concretizing if the space is specifically
Lab. Required as the inputs to the ICC profile must be 0->1. gx_remap_color
and its children do this for us, but gx_concretize_color does not.

2) Do not corrupt the device color from the interpreter if we are converting
to a different colour space, use a temporary structure instead.

3) Make sure to use frac2float after concretizing to convert the values.

4) Don't forget to update the saved colour (in the device) after we've
converted colours.

5) Update pdsdf_set_color so that if we are using the new colour code we
get the expected number of output components from the ICC profile attached
to the device, rather than the device 'color_info'. Update all calls to
psdf_set_color so that they pass in the required boolean.

This code is still switched off by default, so no cluster differences will
show up.

gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfv.c
gs/devices/vector/gdevpsdf.h
gs/devices/vector/gdevpsdu.c


2013-10-31 07:11:47 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
5929829c83498b2694bd32cf3579e151c1c99f0d

Added support for VS2013 to msvc.mak.

gs/psi/msvc.mak


2013-10-30 17:56:00 +0000
Robin Watts <robin.watts@artifex.com>
b87f410b4084c84242c254c70c379b96c8fca2d7

Ensure that gdev_prn_dev_spec_op forwards to the real device.

When the clist hijacks all the device entries, it attempts to forward
the dev_spec_op calls to the generic printer device. This doesn't
help when we have a device specific one. Only the printer device
knows what the original procs were, so the best we can do is to have
gdev_prn_dev_spec_op forwarding.

This was important as the adjust_bandheight gxdso call was not making
it through to the underlying device.

gs/base/gdevprn.c
gs/base/gdevprn.h
gs/base/gxclist.h
gs/base/gxclrect.c
gs/base/gxpcmap.c


2013-10-24 21:07:31 +0100
Robin Watts <robin.watts@artifex.com>
bdf630af4252ba87bffa6108840bac53f4754cea

Remove unnecessary code.

The test is unneccessary due to us being within a if.

gs/base/gdevprn.c


2013-10-31 10:10:21 +0000
Chris Liddell <chris.liddell@artifex.com>
9c77012daa9b1903d7be5fc4f239a46df863d0db

Add quotes to conditional for safety.

CLUSTER_UNTESTED

gs/base/msvclib.mak


2013-10-30 14:19:06 -0700
Michael Vrhel <michael.vrhel@artifex.com>
75a8be6597d6ce56182c5391d6be02f997a1aa21

Addition of code to test if current ICC color space is the same as new ICC color space

gs/psi/zcolor.c


2013-10-30 18:30:42 +0000
Chris Liddell <chris.liddell@artifex.com>
5c511841cbe373743165e2248adc583382ca3b2a

Avoid warning for missing (not required) encoding for PDFs

Check earlier for the existence of an encoding entry in a PDF font object,
for font types in which encoding is optional. Avoids a benign but annoying
warning from the PDF interpreter.

No cluster differences.

gs/Resource/Init/pdf_font.ps


2013-10-28 18:45:31 +0000
Chris Liddell <chris.liddell@artifex.com>
c186880d7e3651c8a76e55bc981fc22e4a57ea94

Bug 694733 (part 2): ensure jmp_buf alignment is correct

Move the jmp_buf used by the HP/GL parser to be a local variable, accessed
via a pointer in the state (rather than directly allocated within the state).

This ensures that any alignment requirements are met - specifically, 64 bit
MS Visual Studio 2010 requires that jmp_bufs be aligned to 16 byte boundaries.

No cluster differences.

pcl/pgmand.h
pcl/pgparse.c


2013-10-28 11:08:19 +0000
Chris Liddell <chris.liddell@artifex.com>
16fbdade9a29352ad936455eab65e77a9db6f768

Bug 694733 (part 1): fix incorrect offsets in chunk allocator

When I changed the chunk allocator to honor the alignment value for the
memory manager, I missed a couple of places where the calculation of the offset
to get from the allocated memory address to the address of the chunk node.

No cluster differences.

gs/base/gsmchunk.c


2013-10-26 13:42:34 -0600
Henry Stiles <henry.stiles@artifex.com>
8f491ec1493bcb11583d450a264a1b80d5557217

Fix 694737 - Typeface mask incorrect.

The typeface value is in the first 12 bits and the vendor info in the
next 4 bits of the short value that stores typeface information. We
were extracting the first 11 bits for the typeface. This problem is
not associated with a known bug, and in fact, it is quite unlikely to
result in a problem, but it is incorrect. Thanks to Norbert Janssen
for pointing out the problem.

pcl/pcfsel.c


2013-10-24 20:22:18 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
1b691ea92ead0590c619ec64a00d93f24452bb2c

Fix Luratech build (by removing spurious JPX_AUTOCONF_CFLAGS= from configure.ac).

gs/configure.ac


2013-10-24 20:03:15 -0600
Henry Stiles <henry.stiles@artifex.com>
5c08e60fc75c940ce6c6df1e75802ce2d72fbd2f

Fix bug 694725 - bad characters in numeric input not processed
correctly.

Thanks to Norbert Janssen for finding and fixing this problem.

pcl/pcparse.c
pcl/pcparse.h


2013-10-24 08:59:12 +0100
Chris Liddell <chris.liddell@artifex.com>
184dcfd570a96328798e36d8e08495eb426d67f9

Allow user to override configure's color index setting

This command line parameter is not listed in the "configure --help" output
as it is really intended for our use, and not generally by end users.

To build with 32 bit colour indices, issue:
./configure --with-large_color_index=0

to build with 64 bit color indices:
./configure --with-large_color_index=1

This works for both Ghostscript and GhostPDL builds.

The only "wrinkle" is that Ghostscript default to:
"--with-large_color_index=1" (so 64 bit indices)

whilst GhostPDL defaults to:
"--with-large_color_index=0" (so 32 bit indices)

This retains the previous default settings.

No cluster differences.

config.mak.in
configure.ac
gs/configure.ac
main/pcl6_gcc.mak


2013-10-22 11:09:23 -0700
Michael Vrhel <michael.vrhel@artifex.com>
38ed5ffaf81405a3e8ff094afbc2ada05eaf630c

Fix for bug in case where alternate color space for DeviceN and separation is CIE

If the CIE color space has a range different than 0 to 1 we need to rescale before using
the equivalent ICC profile. Fixes bug 694731. Note diffs for 09-34.PS match what is
created by Distiller and AR vers. X.

gs/base/gscdevn.c
gs/base/gsciemap.c
gs/base/gscsepr.c
gs/base/gsicc.c
gs/base/gxcie.h
gs/base/lib.mak


2013-10-23 16:09:21 +0100
Robin Watts <robin.watts@artifex.com>
c7cca8f105194908bb1b28b3e6606be51533b6d9

Fix possible (but very unlikely) SEGV and warning.

It is extremely unlikely that options will be NULL, but check to be
sure.

gs/base/gxclthrd.c


2013-10-23 12:53:49 +0100
Robin Watts <robin.watts@artifex.com>
d76e3a434e699f8974f50d98c0b7e82042fdc7ec

Clean a few #defines out of psdcmyk device.

Not needed since the transition away from compressed color encoding
to planar operation.

gs/devices/gdevpsd.c


2013-10-23 14:34:11 +0100
Chris Liddell <chris.liddell@artifex.com>
ad3e3ed7913986cec6acbc1afe0eff0c57627ddc

Bug 694734: handle Type 0 font in annotation

The code to generate an appearance from an annotation with an AP, the code
required the FontBBox, but failed to take account that the FontBBox is not
required in a Type 0 font.

We now handle it by grabbing the FontBBox from the descendant font - for
which a FontBBox is mandatory.

No cluster differences.

gs/Resource/Init/pdf_ops.ps


2013-10-22 08:23:19 +0100
Chris Liddell <chris.liddell@artifex.com>
ee941e19870761a752277f08c82282f53f4d4fee

Bug 694722: force ptr alignment to 8 bytes for HP-UX

Like Solaris/SPARC, HP-UX appears to require pointer alignment to be 8 bytes
even when user space pointers are 32 bits.

No cluster differences.

gs/base/genarch.c


2013-10-21 13:34:36 +0100
Robin Watts <robin.watts@artifex.com>
25db24cbeb52621cd1e2ae3e79d9b06c97143bc3

Add documentation for process_page.

gs/doc/Drivers.htm


2013-10-22 13:08:14 +0100
Robin Watts <robin.watts@artifex.com>
d2612770174079f423d704af4f68f6c85f63905a

Update fpng device to use downscaler.

gs/devices/gdevfpng.c


2013-10-18 18:36:52 +0100
Robin Watts <robin.watts@artifex.com>
ae8611c998beaad5e6f0cd2b85abb1b1995d94c4

Add fpng device.

Example 'fastpng' device for process_page.

gs/devices/devs.mak
gs/devices/gdevfpng.c
gs/ghostscript.vcproj
gs/psi/msvc.mak


2013-10-18 22:14:55 +0100
Robin Watts <robin.watts@artifex.com>
afe18de12b530d8d95a132755516847e8fc3f88e

Add gxdso_adjust_bandheight

Add mechanism for adjusting the bandheight. Intended to allow devices to
exert fine control over bandheight while ghostscript still handles the
gross sizing. An example would be the downscaler ensuring that bands are
multiples of the given downscale.

gs/base/gxclist.c
gs/base/gxdevsop.h


2013-10-22 13:06:40 +0100
Robin Watts <robin.watts@artifex.com>
edd06c70150166780f1360a42499569f3a52903e

Update downscaler to allow for process_page operation.

(No error diffusion in this mode, as bands need to be independent).

gs/base/gxdownscale.c
gs/base/gxdownscale.h


2013-10-21 12:03:42 +0100
Robin Watts <robin.watts@artifex.com>
ca5a608fe9062492f53c80eccb8b78dbdb997499

Add default process_page implementation.

This serves to handle the page mode case.

gs/base/gdevdflt.c
gs/base/gxdevice.h


2013-10-18 18:36:26 +0100
Robin Watts <robin.watts@artifex.com>
a25313d4518a942d74528ee7b6a52c96aa0128b6

Add process_page entry point.

Add clist implementation (both threaded and non-threaded) for process_page.

gs/base/gxcldev.h
gs/base/gxclist.c
gs/base/gxclthrd.c
gs/base/gxclthrd.h
gs/base/gxdevcli.h


2013-10-21 11:54:33 +0100
Ken Sharp <ken.sharp@artifex.com>
d7bff9b2f7230b527765661ea721d4b60e0e4154

pdfwrite - free Named Images stack before clearing local/global named objects

Bug #694136 "Seg faults found by fuzzing in cos_value_free"

If we stored named images in the initial name space then when we closed
the PDF file we would free and delete the local named objects before we
freed the named images stack. If the named images stack included entries
stored in the local named objects stack then we would attempt to free an
object which was already freed.

So we clear the named images stack first, for added safety we ensure we
clear the NI stack before global named objects are freed too.

No differences expected.

gs/devices/vector/gdevpdf.c


2013-10-19 10:50:17 +0100
Ken Sharp <ken.sharp@artifex.com>
8dbe789dec0a8be00942849f768648da60ee3336

pdfwrite - do not compose font name with CMAp when creating a CIDFOnt

Bug #694721 "Issued with font names in pdfwrite device"

When creating a CIDFont for output to a PDF file, we created the name by
composing the CIDFont name with the CMap originally used with the font.
However, this doesn't make sense, the CIDFont we emit is not composed with
that CMap, its usually composed with an Identity CMap. The CIDFont is
still arranged according to the original CMap, but this is the Ordering
of the font, not the CMap being used with it, and we record that Ordering
(should it be useful for anything) in the CIDSystemInfo.

We now do not add the CMap name to the CIDfont name, which allows Acrobat
to do a 'better' job of copy and paste (apparently it passes the font name
along).

No differences expected

gs/devices/vector/gdevpdtf.c


2013-10-18 18:33:21 +0100
Robin Watts <robin.watts@artifex.com>
7936b2643f2577fb70fdf2b8d9e3af5c8058668d

Fix memory leak on error in gxclimag.c

If we fail to allocate pie->buffer, there is no need to free it during
the clean up. On the other hand, it's probably a good idea to free 'pie'.

Also, for good style, if nothing else, avoid pinfo being returned with
a dangling pointer.

gs/base/gxclimag.c


2013-10-17 21:06:02 -0700
Ray Johnston <ray.johnston@artifex.com>
357ec4e2553a80c2bb6df29bb33ad095ac343242

Fix Bug694714. Clamp the ymin/ymax values to valid device coordinates.

In write_image_end_all, we could advance to a band past the end of the
page that didn't have a pcls in the states array, causing a segfault
when garbage values were used.

gs/base/gxclimag.c


2013-10-18 11:35:06 +0100
Ken Sharp <ken.sharp@artifex.com>
b21c6dd0fc782709712307f58fe0685634c6db30

pdfwrite - Improve robustness of type 1 font interpreter

Bug #694214 "Seg faults found by fuzzing in type1_next"

The font is corrupted and one of the glyph instrctions performs a 'return'
without previously executing a subroutine. This caused the font interpreter
to crash.

We now check when executing a return to see if we are not in the main glyph
program, if we are, we return an invalidfont error.

No differences expected

gs/devices/vector/gdevpsfx.c


2013-10-17 12:56:38 +0100
Ken Sharp <ken.sharp@artifex.com>
fc7ead6d34638a521a48debeb9437eac4e82ef98

pdfwrite - some casts to prevent compiler warnings

gs/devices/vector/gdevpdfc.c


2013-10-17 12:08:54 +0100
Ken Sharp <ken.sharp@artifex.com>
3cd2f7878bdae2d954ab27906336a9b87a267cd9

pdfwrite colour code - after concretizing a DeviceN space, don't attempt to convert it again

gs/devices/vector/gdevpdfg.c


2013-10-17 12:07:11 +0100
Ken Sharp <ken.sharp@artifex.com>
bbb32ec3f43405bd794f5d60f58f2d1bb7f5546b

pdfwrite colour - ensure icc_equivalent is set before trying to use it.

gs/devices/vector/gdevpdfc.c


2013-10-17 08:19:33 +0100
Ken Sharp <ken.sharp@artifex.com>
88df0b8fe9cce08b30ae7b12d6a1e8aa104981e2

pdfwrite - check before dereferencing a pointer

Bug #694716 - "seg fault with pdfwrite"

No differences expected

gs/devices/vector/gdevpdfm.c


2013-10-16 09:26:35 -0600
Henry Stiles <henry.stiles@artifex.com>
82fc3bd9f058974403d9f9ff9945391a6b8b20f6

The color index size was not transmitted properly from the MSVC
PCL/PXL/XPS makefiles to the Ghostscript makefile system.

common/msvc_top.mak
gs/base/msvclib.mak
gs/psi/msvc.mak
main/pcl6_msvc.mak


2013-10-16 00:59:19 +0100
Robin Watts <robin.watts@artifex.com>
8e9b3ce974cbd12452ae11ff1ff4cd48e4a261a9

Add downscaler support to pngalpha.

gs/devices/gdevpng.c
gs/doc/Devices.htm


2013-10-15 10:31:33 -0700
Michael Vrhel <michael.vrhel@artifex.com>
a438d95a859b430e58ef448a0995aa13cefac172

Minor fixes for use of equivalent ICC profiles from PS objects with pdfwrite

gs/base/gsicc_cache.c
gs/devices/vector/gdevpdfg.c


2013-10-14 16:56:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
9a441022bfe6f59dacdca40ce60c37ee02adfa07

Fix for error when nos had shape and alpha_g during compositing.

gs/base/gxblend1.c


2013-10-14 10:30:03 -0700
Michael Vrhel <michael.vrhel@artifex.com>
1c1f1619da98236ea06c4fdb1ea403d5ab990e08

Make sure to set the soft mask opacity to one so that we do not apply the
global path opacity multiple times when we have an opacity and a soft mask
from an image. Fix for Bug 694705

xps/xpsgradient.c
xps/xpsimage.c
xps/xpsopacity.c


2013-10-14 17:14:59 +0100
Ken Sharp <ken.sharp@artifex.com>
a0b7b91e2ca181e06fe11a89c5240e78b6e31aaf

pdfwrite - check return values from 'convert color'

Bug #694221 "Valgrind issues found by fuzzing in choose_DCT_params (gdevpsdi.c:156)"

In the past convert_color could not fail, with ICC handling, it can, so
we need to check the return code and handle errors gracefully.

This would not in fact have caused problems, but we fix it anyway.

gs/devices/vector/gdevpsdi.c


2013-10-11 16:18:32 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d28da52a57923eb76503277d8be2eb0c72165599

Fix free mistake made in knockout commit http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=2d2cc321df4223fd7cf64946ac2fa963fa1cea3d

gs/base/gdevp14.c


2013-10-11 15:33:55 +0100
Chris Liddell <chris.liddell@artifex.com>
561b37fb083fa0dc32ea81b4aaea38607db05814

Remove the -dDisableFAPI hack from the "languages" builds

No cluster differences.

pl/plmain.c


2013-10-11 15:24:43 +0100
Chris Liddell <chris.liddell@artifex.com>
31ca73d856f974c7e1422948b2fb5794af55bf58

Have FAPI honor GridFitTT parameter.

The FAPI code now passes the GridFitTT parameter onto the scaler/renderer
interface code.

The default setting is now "1" for using the bytecode hinting. "0" disables
all TTF hinting, and "2" (with Freetype) enables Freetype's "autohinting"
algorithm. With other scalers the paramter currently has no effect, and
the "2" setting will *always* be scaler dependent.

Causes differences in pretty much every cluster PCL file containing TTF
glyphs as (and I still think this is a bad idea) PCL disables hinting at 300
dpi and above. No differences in PS/PDF/XPS/PXL jobs.

gs/base/fapi_ft.c
gs/base/fapibstm.c
gs/base/fapiufst.c
gs/base/gsfont.c
gs/base/gxfapi.c
gs/base/gxfapi.h
gs/doc/Language.htm
pl/plfapi.c


2013-10-11 09:45:56 +0100
Ken Sharp <ken.sharp@artifex.com>
9c13e3b9e735ba119f58c751a51fc55efef15a0c

xps interpreter - correct high level pattern handling

A silly error was causing fills to be applied twice. For opaque fills this
is merely a performance penalty but for transparent fills the result is
incorrect.

Thanks to Phil McSharry for identifying the problem and supplying a solution.

This shows progressions in a number of test files.

xps/xpspath.c


2013-10-11 08:09:01 +0100
Ken Sharp <ken.sharp@artifex.com>
6e10e787517ae0212ada6b7735542cbb4c41040c

Squash a scan-build compiler warning.

Prevent any possibility of a null-pointer dereference.

gs/base/gsdevice.c


2013-10-10 13:34:37 +0100
Ken Sharp <ken.sharp@artifex.com>
72afba4af187b01fded403d6a986d5de0be741d2

txtwrite - fix UTF-8 output Bug #694690

Thanks to r_one_guy@yahoo.fr for pointing this out and supplying a fix. The
UTF-8 output was incorrect for Unicode values between 0x80 and 0x7FF.

Also, we weren't outputting a BOM for Unicode (UCS2) output.

Not cluster tested

gs/devices/vector/gdevtxtw.c


2013-10-10 12:15:54 +0100
Ken Sharp <ken.sharp@artifex.com>
f924bf4d2bb4243ebe771e7e42bf1df3e41f415a

pdfwrite - don't emit extra blank page with '%d' output file spec

Bug #694576 "Using %d with pdfwrite results in extra, blank page"

Added a flag to the PDF device structure so that we can tell if pdf_close
has been called as the result of outputting a page. If it has not, and
the page is unmarked, and we are outputting in 'file per page' mode, then
we don't emit the page.

However, this leads to a 0 byte output file, so we also need to delete the
current output file. There seemed to be no obvious way to do this, so I
have added a gx_device_delete_output_file very similar to the existing
gx_device_open_output_file and gx_device_close_output_file routines.

No differences expected.

gs/base/gsdevice.c
gs/base/gxdevice.h
gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfx.h


2013-10-03 15:15:53 +0100
Chris Liddell <chris.liddell@artifex.com>
68fa228ade5d2f7496b96676aaa1f82be4584362

Bug 694519: improve PCL performance with FAPI

Correctly maintain "design_grid" parameter in the font/matrix pair
structure, for FAPI handled TTFs.

Change a "return" to a "return_error".

Retrieving glyph metrics was sub-optimal as my original implementation used
a gs_text_process() call, which uses the entire "show machinery".

This implementation calls gs_fapi_do_char() directly. This has several benefits:
we only need a "skeleton" text enumerator, and a "skeleton" graphics state,
cutting down the local overhead setup. We also cutout a whole lot of setup
done as part of gs_text_begin() and during gs_text_process() itself. Finally,
we avoid a lot of "stuff" related to showing entire strings, when we're only
ever handling a single glyph at a time.

A final optimisation is in the FAPI/FT code: if we're just retrieving metrics,
we no longer take the action of retrieving the glyph from FT - which is not
a very cheap operation.

This commit causes ~100 cluster tests to have pixel shift differences.

gs/base/fapi_ft.c
gs/base/gxccman.c
gs/base/gxfapi.c
gs/base/gxfapi.h
gs/psi/zfapi.c
pl/plfapi.c
xps/xpsfapi.c


2013-10-09 12:25:56 -0700
Michael Vrhel <michael.vrhel@artifex.com>
83565d8264e96312df8c26055aaa0e23e57c4c8d

Add missing reference to $(memory__h) in gsicc_lcms2.c lib.mak

gs/base/lib.mak


2013-09-30 13:14:52 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2d2cc321df4223fd7cf64946ac2fa963fa1cea3d

Knockout non-isolated transparency group support.

Fixes bug 692766

Proper non-isolated knockout group support added.

This commit adds non-isolated knockout group support to gs. Also, previously, non-isolated groups that
had color space mismatches were being forced to be isolated. We now color convert the parent buffer
to the new groups color space to ensure that the group is handled in the way it should.

This work revealed an issue in the color handling of planar buffers which was also fixed.

Also, an issue with clipping to the soft mask boundary during a transparency group pop was was
discovered and fixed as well as an overprint simulation issue in transparency.

Several progressions occurred with this fix.

Fixes bug 692766.

gs/base/gdevp14.c
gs/base/gdevp14.h
gs/base/gscsepr.c
gs/base/gsicc_cache.c
gs/base/gsicc_lcms2.c
gs/base/gstrans.c
gs/base/gxblend.c
gs/base/gxblend.h
gs/base/gxblend1.c
gs/base/lib.mak


2013-10-08 11:25:11 +0100
Chris Liddell <chris.liddell@artifex.com>
1969b28c60d666b5eab0050169b5b9aae1a28db5

Bug 694699: Scale FAPI's font BBox for units.

When FAPI "refined" the FontBBox from the scaler's data, it failed to correctly
take account of the units in which the scaler returned the values.

There was some code which *may* have been an attempt to handle it, but was
wrong in the general case. That's removed in favour of handling it properly.

Several regression files show differences, mainly with pdfwrite/ps2write: many
are pixel differences due to rounding, some are progressions. One was wrong
prior to this commit, and is slightly differently wrong with it.

gs/base/fapi_ft.c
gs/base/fapibstm.c
gs/base/fapiufst.c
gs/base/gxfapi.c
gs/base/gxfapi.h


2013-10-08 13:08:17 +0200
Tor Andersson <tor@ccxvii.net>
8b28b7dfd503146f7e2355a5dad9202b35405256

xps: Look harder for a font name in the 'name' table.

We used to look only for "Mac Roman, English" strings, now also try
"MS Unicode, United States" and "MS Unicode UCS-4, United States" if
the mac roman string can't be found.

xps/xpsfont.c


2013-10-07 16:05:07 +0100
Ken Sharp <ken.sharp@artifex.com>
7276c1f94cfa55aed0554d45858652ee1cac2097

correct a scan-build warning by checking a return value

No differences expected

gs/devices/vector/gdevpdfi.c


2013-10-07 15:05:22 +0100
Ken Sharp <ken.sharp@artifex.com>
1bdb7a9e1a3064b5e8abf29dcdfa9d279715ae34

Have pdfwrite ignore WMode=1 when a font has no Metrics2 entry

This arose while investigating a customer bug. Sadly its not actually
anything to do with the customer problem, but it was incorrect. The spec
says that if a font has WMode 1 but has no Metrics2 entry it should be
treated as horizontal (WMode = 0)

Quality Logic file 16-09.ps shows a progression with this change.

gs/devices/vector/gdevpdte.c
gs/devices/vector/gdevpdtt.c
gs/devices/vector/gdevpdtt.h


2013-10-04 08:17:40 -0700
Robin Watts <robin@peeves.(none)>
cdde8014aa4fe051743fad132f132fd608463744

Bug 694249: Fix JBig2Dec using broken image regions.

When decoding a "generic immediate region" in jbig2dec, if
we detect an error, we should not use the image as it may not
have been entirely initialised.

gs/jbig2dec/jbig2_generic.c


2013-10-02 09:51:31 -0700
Ray Johnston <ray.johnston@artifex.com>
41c13b4cc25b456d3862a73235ddbce09a85a104

Fix Segfaults with --saved-pages.

If the page was not large enough to use Banding mode, the clist_reset
would crash after the print request finished and the page reloaded.
The gx_saved_page_load needs to be after the saved_pages_list is put
back in the device.

Also, the "file_is_new" status was incorrect if pages were saved, but
no printing was done. This was seen with the TIFF devices and psdcmyk.

The psi/imainarg.c has a #define FORCE_SAVED_PAGES_TEST (disabled by
default) to simplify testing on the cluster without modifying command
line parameters.

gs/base/gdevprn.c
gs/base/gxclpage.c
gs/psi/imainarg.c


2013-10-01 17:52:43 +0100
Robin Watts <robin.watts@artifex.com>
dcc172feb018bfe0613f90ce76ce25dd1eafe3ce

Bug 689098: Only dash paths when the dashing would be visible.

If the ctm doesn't expand the dash lengths to be > 1 pixel, then
they can't be seen, so don't bother.

gs/base/gsmatrix.c
gs/base/gxstroke.c


2013-10-01 13:41:28 +0100
Robin Watts <robin.watts@artifex.com>
607370ce1a661d8657d5255056d810551c04d642

Bug 692650 - remove dead code in gxifast.c

A piece of code that was obviously left in a special case due to
cut and pasting can be removed. This will probably not actually
make any difference as a decent compiler (ha!) would optimise
it out anyway, but it's neater to remove it.

gs/base/gxifast.c


2013-10-01 12:44:13 +0100
Robin Watts <robin.watts@artifex.com>
9b43b8b20c6344ccac7fac48151161a51743246b

Add openjpeg files to ghostscript.vcproj

gs/ghostscript.vcproj


2013-09-28 08:29:45 +0100
Ken Sharp <ken.sharp@artifex.com>
29ed18f26f78d3e737b5e73452b1aa1a90088144

Eliminate some scan-build warnings in the ramfs code

The warning in gsioram.c is bogus, but hopefully this change will eliminate
it anyway.

2 lines deleted in ramfs.c were benign but pointless. The final deletion
could have caused a seg fault when memory was exhausted.

No differences expected

gs/base/gsioram.c
gs/base/ramfs.c


2013-09-27 16:03:04 +0100
Ken Sharp <ken.sharp@artifex.com>
be574c5550733da6b2ffa43fbc2099ae01608797

PDF interpreter - update to BPC change for JPEG2000

Bug #694621

If we find a box, which we shoudl not as this is only supposed to be used
when each colour channel has differing depth, we parse teh BPC from that,
and ignore the BPC in the ihdr box.

If the components are not all equal, we use the first one and raise a
warning.

No differences expected

gs/Resource/Init/pdf_draw.ps


2013-09-27 11:24:32 +0100
Ken Sharp <ken.sharp@artifex.com>
6fe7ace41f8afaba72f0f1da7747c062382346fc

PDF interpreter - treat invalid BPC of 128 in JPEG2000 files as 8

The test file has JPEG2000 images (produced by JasPer) which have a BPC
of 128. The valid range for JPEG2000 is 1->38 and for PDF is 1, 2, 4, 8,
12 or 16. Acrobat (of course) opens the file without complaint.

It appears that the image actually has 8 BPC so we specifically treat
this invalid value as 8.

No differences expected.

gs/Resource/Init/pdf_draw.ps


2013-09-26 14:07:19 -0600
Henry Stiles <henry.stiles@artifex.com>
49c0d08e7e04c8c4e1472142461f3ed369089639

Fix 694614 - Properly handle a resolution argument of zero.

pcl/rtgmode.c


2013-09-26 13:55:53 -0600
Henry Stiles <henry.stiles@artifex.com>
0f815674bfda9f940a20bb703d124f27b92de181

Fix 694615 - CCITT filter overflow.

The type of image columns in the graphics library CCITT filter is a
signed integer and PCL was assuming an unsigned and therefore did not
check for possible overflow.

pcl/rtraster.c


2013-09-26 10:31:51 -0600
Henry Stiles <henry.stiles@artifex.com>
3f02bbe5fad16e1f44131cb444e488e96157de5a

Fix 694616 - Fuzzing uncovered a modulo divisor of 0

pcl/rtraster.c


2013-09-17 16:49:51 +0100
Ken Sharp <ken.sharp@artifex.com>
c561232cf26e060b89fc4f3bd4bf5c679731d4db

pdfwrite - add support for form preservation from PostScript

Bug #687561 et al

We add the new operators .beginform and .endform which call device spec_op
methods in order to allow devices to capture form streams. Devices can
also return a matrix to replace the CTM for the course of the form.

Modified pdfwrite to capture and store forms, and set the CTM to the
pdfwrite general matrix (resolution/72).

Added new PDFexecform for use by the PDF interpreter, trying to capture
forms from PDF files is fraught with difficulty because we already capture
transparent forms as forms.

Because some kinds of forms cannot be successfully preserved (only happens
with badly behaved PostScript) we need a way to prevent forms from being
preserved. This option does that.

Examples of badly behaved PostScript can be found in a few Quality Logic
CET tests (use of setgstate in a form to set the CTM to a state prior to
the form execution, and use of setflat with a parameter derived from the
CTM. So we add UNROLLFORMS to the gs_cet file.

gs/Resource/Init/gs_cet.ps
gs/Resource/Init/gs_lev2.ps
gs/Resource/Init/pdf_draw.ps
gs/base/gdevdflt.c
gs/base/gsform1.h
gs/base/gxdevsop.h
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfi.c
gs/devices/vector/gdevpdfx.h
gs/doc/Ps2pdf.htm
gs/psi/int.mak
gs/psi/zform.c


2013-09-26 10:34:34 +0100
Chris Liddell <chris.liddell@artifex.com>
a62129ba436ff3a35c92c704a905d21ceae09a88

Bug 694575: workaround for filenameforall in regression tests

(This is slightly hacky!)

For the regression testing, especially the weekly tests, several of the QL
CET files give variable results depending on the exact content of the current
working directory - because they use filenameforall and vary their output based
whether it returns an error (mainly due to the path ending up too long for the
scratch string).

This commit "patches" the filenameforall operator to catch those cases, and
(hopefully) always return with no files, and no errors, thus giving consistent
results between runs.

Cluster differences in the CET files, as expected.

gs/Resource/Init/gs_cet.ps


2013-09-25 18:12:58 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f9d0691129945b6d0657effcec6e6c440f57a364

Bug 694137 : Prevent accessing outside of array.

gs/openjpeg/libopenjpeg/jp2.c


2013-09-23 14:54:55 +0100
Chris Liddell <chris.liddell@artifex.com>
f945f8b050fb0a64f5de746f253244afa107bff8

Bug 694586: Have chunk allocator honor alignment

Have the chunk memory manager honor the same alignment as the rest
of the memory manager(s).

Fixes potential bus errors on SPARC.

No cluster differences.

gs/base/gsmchunk.c
gs/base/lib.mak


2013-09-23 10:55:34 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b6d163b01a4ecca30503fbd770770b1bd7de73e2

Fix potential access violation and add error checking in pdf14 put image.

Fixes segv in fuzzing Bug 694190

gs/base/gdevp14.c
gs/base/gxblend1.c


2013-09-23 09:56:14 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b8bb26de721811ca80712d8540e9279b4dca5bc9

Add error code checking in image color initialization

Fix for bug 694175

gs/base/gxipixel.c


2013-09-23 08:08:50 -0700
Robin Watts <robin@peeves.(none)>
f39d9824015ff6f909a59f697947f262d2c9c21c

Bug 694289: Avoid SEGVs sue to Xmprintfs with mem = NULL

If no memory pointer is supplied to a printf, then (in threadsafe
builds) return doing nothing or (in non-threadsafe builds) use the
default one.

Also tweak the lib ctx closedown so that we safely closedown
without trying to print anything via undefined print pointers.

gs/base/gslibctx.c


2013-09-23 15:19:04 +0100
Robin Watts <robin.watts@artifex.com>
23ef9ea1fd7193c19c37c9cd00c6aad52a992fd1

Bug 694162: Harden gx_forward_dev_spec_op against SEGVs.

If tdev == 0, don't pass on the call. I cannot reproduce the bug,
but this seems like a sensible precaution.

gs/base/gdevnfwd.c


2013-09-23 14:29:50 +0100
Robin Watts <robin.watts@artifex.com>
8c5cbff3351774ac55704c9c633112922313c74b

Bug 694159: Check return code on color remap.

If return code is ignored, returned device color may be used when
it is not initialised.

gs/base/gsshade.c


2013-09-22 20:56:11 -0700
Michael Vrhel <michael.vrhel@artifex.com>
81b54e2a9237dec0186ad331af845800011ae6d2

Improved error recovery during transparency group popping.

If the creation of the ICC link fails then we attempt a non-ICC mapping. Fix for fuzz segv bug 694191.

gs/base/gdevp14.c


2013-09-22 19:13:04 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
9f29534318f7a70eb42408a2bdca51dad7181c16

Added ink_cov device (Bug 694501).

Thanks for Billon Marc <billon.m@free.fr> for the patch.

gs/base/macos-mcp.mak
gs/base/macosx.mak
gs/base/openvms.mak
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/configure.ac
gs/devices/devs.mak
gs/devices/gdevicov.c
gs/psi/msvc.mak


2013-09-21 22:36:34 -0700
Michael Vrhel <michael.vrhel@artifex.com>
af81a6bf1a5de5d8cc23aaec7ae663c8985767c7

Fix improper error checking in icc color space installation

Fixes fuzzing segv Bug 694192

gs/psi/zicc.c


2013-09-20 23:08:57 -0700
Michael Vrhel <michael.vrhel@artifex.com>
bbb9f59c59f7e229001e9e8413ff6ebf812910de

Add in pdf14 abort compositor action

The fuzzing files have identified that the interpreter was popping the
pdf14 device during a stop. This caused the pdf14 device to think it
was time to do its put_image command since it was done, causing a lot
of potential segv issues. This commit adds an abort compositor action
which will clean up the pdf14 device and set it back up as a pass through
device allowing for a more graceful exit.

gs/Resource/Init/pdf_main.ps
gs/base/gdevp14.c
gs/base/gstrans.c
gs/base/gstrans.h
gs/base/gxdevcli.h
gs/devices/vector/gdevpdft.c
gs/psi/ztrans.c


2013-09-20 12:19:36 -0600
Henry Stiles <henry.stiles@artifex.com>
46b8210665fe111b2fa544eed4a661de831d245e

Include another GL/2 command (SP) which can be used to initialize the
GL/2 interpreter, see related fix with bug #694595 for problem
details.

pcl/pcparse.c


2013-09-19 10:04:17 +0100
Ken Sharp <ken.sharp@artifex.com>
a5fa1ac21714a2dfdbcd3b9d70bc5cd913764ef3

pdfwrite - extend TrueType MaxPoint checking to include CID fonts

Further to commit 8b6be8be2cdcefae39339682d45d3c009ab909ac which added
checks for MaxPoints and NumContours before merging TrueType fonts, this
commit adds the same checks to CIDFonts with TrueType base fonts.

Also, relax the checks somewhat. As long as the new font doesn't have
*more* points, or contours, its safe to merge with the existing font.

No differences expected

gs/devices/gxfcopy.c


2013-09-18 13:56:35 -0700
Michael Vrhel <michael.vrhel@artifex.com>
142b12b12b56aba0d4ec7372c0260c39d2d58d28

Additional error checking fixes from fuzzing files

Fixes Bug 694154

gs/base/gsicc.c
gs/base/gsstate.c


2013-09-18 12:26:43 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2236e20a9604602a12a9fbefc05e162d12954b03

Fix error checking for fuzzing case where pdf14 pattern accumulator target was closed

Fixes 3842.pdf.SIGSEGV.201.3160

gs/base/gdevp14.c


2013-09-18 10:31:50 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c6fbf53542a13b9a8582aef2c50bba7a145a8e49

Error code checking fix.

Fixes Fuzzing Bug http://bugs.ghostscript.com/show_bug.cgi?id=694161

gs/base/gximag3x.c


2013-09-17 11:37:05 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f4a1368a6585d20a218acd236d97706401a1b8c1

Fix for pattern, transparency, clipper interaction issues

Three issues this fixes. One is that if a clipper device is installed during the filling
with a transparency tile, we need to make sure we get the pdf14 device to pop the group
and not use the clipper device.

The second issue was that fit_fill was not getting used properly in the tile filling code.

The third issue was that the wrong dimensions were supplied to gx_trans_pattern_fill_rect when
the pattern was clist based.

This should fix Bug 693365.

gs/base/gdevp14.c
gs/base/gxp1fill.c


2013-09-17 20:02:34 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3f098349c0ff70a50ebb0341f1e98da2c2330c84

Bug 694132: Resolve uninitialised variable and handle returning error correctly.

gs/base/gdevprn.c
gs/base/gxicolor.c


2013-09-17 08:47:18 -0600
Henry Stiles <henry.stiles@artifex.com>
54ab9a05fbc13ad402aaa63c86d9ec0422bd112a

Fix # 694595 - nothing produced reading PCL files.

This change allows the command BP (Begin Plot) to initiate the HPGL/2
parser for improperly constructed GL/2 files that lack the Enter GL/2
command (<ESC>%1B).

pcl/pcparse.c


2013-09-17 13:50:56 +0100
Robin Watts <robin.watts@artifex.com>
5347e2c3e43a28f64b0e4775945c6a58ee72debf

Bug 691182: Disable interpolation for Type3 postscript images

If we interpolate an image, but not its mask we get nasty edge
effects. We therefore choose not to interpolate either.

gs/psi/zimage3.c


2013-09-13 13:28:16 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b7094e220951fc76656056a426ab7fa1363f38b7

Make sure the mono device that is created for non-FAPI bold font caching has icc procs set.

Fixes bug 694551

Note Enhancement Bug 694593 was opened with this commit so that I will remember to review
the setting of the get_profile procs for these devices.

gs/base/gdevmem.c
pl/plchar.c


2013-09-07 06:05:01 -0700
Michael Vrhel <michael.vrhel@artifex.com>
752aeb0e47fc11aff22618a00dd07576647c192d

Avoid forced white point mapping in CMM when the source profile is derived from CIE PS type.

LittleCMS and perhaps other CMMs have methods to force the white point in the mashed transform
between source and destination color space. The methods used can lead to incorrect results
when the source space is a non-traditional profile like those derived from CIEDEF(G) types.
This fix gets and sets the appropriate flags for the CMM to avoid the white point alignment
when the source space is PS based. Fixes bug 693826

Fixing this bug revealed an issue in the CIEA color space conversion.

Also, fixed old bug, mapping cie ps color spaces to ciexyz to allow ciexyz values larger than 1.0.
Fixes bug 692807.

Started changes to add in V2 profile creation.

Fixed error handling in this part of code also.

gs/base/gscie.h
gs/base/gsciemap.c
gs/base/gsicc.c
gs/base/gsicc_cache.c
gs/base/gsicc_cms.h
gs/base/gsicc_create.c
gs/base/gsicc_lcms.c
gs/base/gsicc_lcms2.c
gs/base/gsicc_manage.c
gs/base/gsicc_manage.h
gs/base/gxcie.h
gs/devices/gdevrinkj.c
gs/devices/gdevxcf.c
gs/devices/vector/gdevpdfk.c


2013-09-12 18:08:53 +0100
Robin Watts <robin.watts@artifex.com>
808e6d525d978b6f083be8eeb2a612b343500693

Bug 694590: Tweak scan converters handling of horizontal lines.

The scan converter only puts horizontal edges into the edge list
if expanding the height of the line by fill adjust causes it to
cover a pixel centre.

Unfortunately, for the fill_adjust = 0.5 case we actually use
adjust_above = 128 and adjust_below = 127, so there is one possible
subpixel offset for which the line will not appear. We therefore
tweak the logic to accept all horizontal lines through in this case.

This produces many diffs, all benign. Sorry Marcos.

gs/base/gxfill.c


2013-09-12 12:21:48 +0100
Ken Sharp <ken.sharp@artifex.com>
002cd5262ccb71010473abfb9069e1fb39f36f12

PDF interpreter - remove the 2D array of objects for large (>64k) objects

Bug #694470

In the past Ghostscript had a limit of 64k entries for arrays and strings
but this proved a problem for some PDF files, so a set of new objects were
defined 'larray' and 'lstring', which were defined as an array of arrays
and an array of strings. New accessor and utility functions were also
created.

With bug 694470 there is an object with an index of 2^32 - 1, which takes
a very long time, as the code allocates more and more sub-arrays.

Now that we have a limit of 2^24 on arrays and strings (which can be increased),
we can remove the 2d array hackery. This causes the bug file to abort almost
immediately while rebuilding the xref. It *should* also provide a modest
performance benefit, and makes the code smaller and easier to deal with.

No differences expected.

gs/Resource/Init/pdf_base.ps
gs/Resource/Init/pdf_main.ps
gs/Resource/Init/pdf_rbld.ps


2013-09-11 16:06:38 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
d97571b56d7c740e7d6aeee064313b96048a5667

Fixed typo in lib.mak introduced in b5472ea6bf

gs/base/lib.mak


2013-09-11 11:11:35 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6dd5b91bbaf237ca3153722887d5965b0eb3633e

Ensure overprint drawn components are updated with color space changes during transparency.

Fixes bug 694297

gs/base/gdevp14.c
gs/base/gstrans.c


2013-09-11 18:47:45 +0100
Robin Watts <robin.watts@artifex.com>
faea7d6e98d6e7ee0b82d891544a13d703a291f5

Bug 690790: Workaround libpng 64bit build bug.

libpng keeps a jmpbuf in it's structure. jmp_bufs have to be 16 byte
aligned on x64 systems, and the png allocator makes no effort to
align the buffer.

The workaround here changes the PNG allocator to allocate it's main
structure in a larger block than it needs, and to actually use a
block in the middle of this to ensure alignment. A pointer is
kept to the real address of the block for freeing.

gs/libpng/png.c
gs/libpng/pngmem.c
gs/libpng/pngstruct.h


2013-09-11 10:15:26 +0100
Ken Sharp <ken.sharp@artifex.com>
b5472ea6bf6925023febdeab12be9dbd83e811f1

update ramfs code

gs/base/gsioram.c
gs/base/lib.mak
gs/base/ramfs.c


2013-09-07 12:01:22 +0100
unknown <ken@.(none)>
db45b95faa06f8204b9a075323125d7f398c5d06

PDF interpreter - process GoToR actions into pdfmarks for pdfwrite

Bug #693427 "GoToR target file information lost after GS processing"

This commit adds GoToR to the Existing GoTo and Named actions which the
PDF interpreter will convert into pdfmarks. pdfwrite already handles
the GoToR action so no changes were needed there.

No differences expected

New ram file system code

Updated from the patch submitted by Michael Slade in bug #226943. This code
removes a single Unix-ism and rewrites the memory allocations to use the
GS garbage collected memory (as is appropriate for PostScript) instead of
using the system malloc.

No differences expected since we have no files that use the ramfs.

gs/Makefile.in
gs/base/gsioram.c
gs/base/lib.mak
gs/base/ramfs.c
gs/base/ramfs.h
gs/psi/msvc.mak


2013-09-07 12:01:22 +0100
unknown <ken@.(none)>
8425cde6e55dfaa26e64e81f54e044187fb98384

PDF interpreter - process GoToR actions into pdfmarks for pdfwrite

Bug #693427 "GoToR target file information lost after GS processing"

This commit adds GoToR to the Existing GoTo and Named actions which the
PDF interpreter will convert into pdfmarks. pdfwrite already handles
the GoToR action so no changes were needed there.

No differences expected

gs/Resource/Init/pdf_main.ps


2013-09-06 17:58:57 -0500
Robin Watts <robin.watts@artifex.com>
e05fe9d24205f50ee12b97c22a5d1b34fa118ed0

Bug 619917: Add support for configurable timeslice

Add more of the patch from Herbert Swann. Many thanks again!

gs/psi/zcontext.c


2013-09-06 15:35:50 -0500
Robin Watts <robin.watts@artifex.com>
ddc4b6753a40b2cbac503dbef300d339979274c8

Bug 691917: Fix SEGVs in display postscript.

Cutdown version of Herbert Swanns patch.

gs/psi/zcontext.c


2013-09-06 15:49:10 -0500
Chris Liddell <chris.liddell@artifex.com>
64de3a6bf2b3a75123ae406076796f23a773aff1

Bug 693629: fix outdated FSF address information.

No cluster differences.

gs/contrib/gdevbjc_.h
gs/contrib/gdevcd8.c
gs/contrib/gdevdj9.c
gs/contrib/gdevlx32.c
gs/contrib/opvp/gdevopvp.c


2013-06-13 18:07:01 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
66d9c0aa17a5abcecd6590e63f0620f7aa51634c

Bug 694311 : GS openjpeg2 integration

WIP : Update with latest OpenJPEG2. Warning - does not compile yet.

WIP : Update code. Warning - does not compile yet.

WIP : Code compiles but is not cluster tested.

Update to build on xeon and macpro

Use default image creation

Add error/info/warning event handlers.

Update fuzzing patch to allow j2kp4-file3-ycc-8bpc.pdf to process correctly.

Update fuzzing patch to allow bug 691816 to process correctly without blurring.

Patch to cater for eYCC colour space.

Patch for indexed colour spaces and cater for bad BPCC header box.

Cater for alpha channel information.

gs/base/openjpeg.mak
gs/base/sjpx_openjpeg.c
gs/base/sjpx_openjpeg.h
gs/configure.ac
gs/openjpeg/libopenjpeg/CMakeLists.txt
gs/openjpeg/libopenjpeg/bio.c
gs/openjpeg/libopenjpeg/bio.h
gs/openjpeg/libopenjpeg/cidx_manager.c
gs/openjpeg/libopenjpeg/cidx_manager.h
gs/openjpeg/libopenjpeg/cio.c
gs/openjpeg/libopenjpeg/cio.h
gs/openjpeg/libopenjpeg/dwt.c
gs/openjpeg/libopenjpeg/dwt.h
gs/openjpeg/libopenjpeg/event.c
gs/openjpeg/libopenjpeg/event.h
gs/openjpeg/libopenjpeg/function_list.c
gs/openjpeg/libopenjpeg/function_list.h
gs/openjpeg/libopenjpeg/image.c
gs/openjpeg/libopenjpeg/image.h
gs/openjpeg/libopenjpeg/indexbox_manager.h
gs/openjpeg/libopenjpeg/invert.c
gs/openjpeg/libopenjpeg/invert.h
gs/openjpeg/libopenjpeg/j2k.c
gs/openjpeg/libopenjpeg/j2k.h
gs/openjpeg/libopenjpeg/jp2.c
gs/openjpeg/libopenjpeg/jp2.h
gs/openjpeg/libopenjpeg/mct.c
gs/openjpeg/libopenjpeg/mct.h
gs/openjpeg/libopenjpeg/mqc.c
gs/openjpeg/libopenjpeg/mqc.h
gs/openjpeg/libopenjpeg/openjpeg.c
gs/openjpeg/libopenjpeg/openjpeg.h
gs/openjpeg/libopenjpeg/opj_clock.c
gs/openjpeg/libopenjpeg/opj_clock.h
gs/openjpeg/libopenjpeg/opj_config.h
gs/openjpeg/libopenjpeg/opj_config_private.h
gs/openjpeg/libopenjpeg/opj_includes.h
gs/openjpeg/libopenjpeg/opj_intmath.h
gs/openjpeg/libopenjpeg/opj_inttypes.h
gs/openjpeg/libopenjpeg/opj_malloc.h
gs/openjpeg/libopenjpeg/opj_stdint.h
gs/openjpeg/libopenjpeg/phix_manager.c
gs/openjpeg/libopenjpeg/pi.c
gs/openjpeg/libopenjpeg/pi.h
gs/openjpeg/libopenjpeg/ppix_manager.c
gs/openjpeg/libopenjpeg/raw.c
gs/openjpeg/libopenjpeg/raw.h
gs/openjpeg/libopenjpeg/t1.c
gs/openjpeg/libopenjpeg/t1.h
gs/openjpeg/libopenjpeg/t1_generate_luts.c
gs/openjpeg/libopenjpeg/t1_luts.h
gs/openjpeg/libopenjpeg/t2.c
gs/openjpeg/libopenjpeg/t2.h
gs/openjpeg/libopenjpeg/tcd.c
gs/openjpeg/libopenjpeg/tcd.h
gs/openjpeg/libopenjpeg/tgt.c
gs/openjpeg/libopenjpeg/tgt.h
gs/openjpeg/libopenjpeg/thix_manager.c
gs/openjpeg/libopenjpeg/tpix_manager.c


2013-09-04 11:03:02 -0700
Michael Vrhel <michael.vrhel@artifex.com>
a92c4411e302b1b99fe65b5d89d26b87671feff5

Removal of default initialization of ICC profile in languages. The default will be set when the page erase occurs.

Thanks to Henry for catching this.

pcl/pctop.c
pxl/pxpthr.c
pxl/pxtop.c
svg/svgtop.c
xps/xpstop.c


2013-08-30 10:00:41 +0100
Chris Liddell <chris.liddell@artifex.com>
45dfe09a18a7c19c626561d506ab44ee68421c41

Update product string, dates and docs for 9.10 release.

Bring master up to date with gs910 branch

gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2013-08-15 16:53:31 +0100
Robin Watts <robin.watts@artifex.com>
edb56190f321ea9e094cb161f9b94941d49a40ae

Update antidropout downscaler.

The antidropout downscaler is not consistent in the way it detects
'darker' colors; some of the code predicates 'darker' on the color
polarity, other parts of it do not.

Here we make it consistently follow the color polarity.

Also, we correctly take the color polarity from the color space, rather
than from the device. Thanks to Michael Vrhel for making the changes
to make this possible.

gs/base/gxiscale.c
gs/base/sidscale.c


2013-09-03 18:01:55 +0100
Robin Watts <robin.watts@artifex.com>
02ab2adaafb3cc9322e54f0ea4e78952c34818d2

Bug 694561: Fix interpolated landscape images (again).

Don't try to accumulate runs of identical pixels in landscape images.
We weren't aligning the transposed data to bitmap_align, and this was
causing problems. It's unfeasible to do so, and the underlying driver
almost certainly will break down to 1 call per pixel, so we might as
well do that immediately and simplify the code massively.

Also fix some warnings/unused variables.

gs/base/gxcindex.h
gs/base/gxiscale.c


2013-08-24 20:44:10 -0700
Michael Vrhel <michael.vrhel@artifex.com>
bdc103f817778f84efe66f10489c88a9263d279f

Addition of new procedure to color spaces to return the polarity of the color space.

gs/base/gsccolor.h
gs/base/gscdevn.c
gs/base/gscolor2.c
gs/base/gscpixel.c
gs/base/gscscie.c
gs/base/gscsepr.c
gs/base/gscspace.c
gs/base/gsicc.c
gs/base/gspcolor.c
gs/base/gxcspace.h
gs/base/gxdevcli.h


2013-09-03 12:59:05 +0100
Ken Sharp <ken.sharp@artifex.com>
5ae4180ca9d17f367acd068537f0a67a243656b8

PS Interpreter - don't interpolate imagemask data for high level devices

Bug #689460 "imagemask interpolation differs from Adobe"

This is rather a long-running bug. The title isn't really very descriptive
of the problem, as far as I can tell the problem only affects pdfwrite.

In the current implementation, interpolation of imagemasks is handled in
*PostScript*, by inserting the ImScaleDecode filter in front of the image
DataSource. This works well for rendering, but for high level devicees
(particularly pdfwrite) this means that we do not embed the original mask
data, we embed the interpolated data. This makes the PDF file much larger
and also means that when opened with Acrobat Reader, the output does not
match, becuase Acrobat does interpolation by applying what looks like a
Mitchell filter, and promoting the imagemask to 8 bpc.

I did look into applying our current scheme in C, as suggested in comment #18,
but that was inordintely difficult. We can't use the existing 1bpp image
interpolation code, as that promotes to 8bpc and uses a Mitchell filter,
so we lose the sharp edges, which is important for a mask. It probably would
be possible to replicate the PostScript code which adds the ImScaleDecode
filter to the DataSource, but there seems little point in doing this in
C when it could be done more easily in PostScript.

So instead I've chosen to test if the current device is a 'high level'
device and, if it is, not to apply the filter.

With pdfwrite this leads to us producing smaller PDF files, as expected,
and the result in Acrobat matching the one from Distiller.

When testing with the cluster a small number of Genoa test files exhibit
differences. These all use the well known 'turkey' image at very low resolution,
with the old code these were interpolated at 720 dpi and that was the image
data written out. Now we write the original data and interpolate to the
resolution of the actual device at rendering time. In the case of 300 dpi
output this results in small but visible differences.

gs/Resource/Init/gs_img.ps


2013-09-01 12:23:04 +0200
Simon Bünzli <zeniko@gmail.com>
42839db66a6cb026691c2e30af3489ff22d96b35

bug 694281: fix memory leaks and compilation warnings

* jbig2_build_huffman_table leaks LENCOUNT and result under OOM conditions
* jbig2_decode_symbol_dict leaks an image in an error case
* jbig2_symbol_dictionary skips cleanup in an error case
* jbig2_text_region leaks GR_stats in various error and non-error cases
* MSVC reports two "unreachable code" warnings and a "signed/unsigned
mismatch" one

gs/jbig2dec/jbig2.c
gs/jbig2dec/jbig2_huffman.c
gs/jbig2dec/jbig2_segment.c
gs/jbig2dec/jbig2_symbol_dict.c
gs/jbig2dec/jbig2_text.c


2013-09-02 12:26:59 +0100
Chris Liddell <chris.liddell@artifex.com>
1c1395aeeee68d545a3f293d6aa0ec38999879c9

Update font versions in PPD files.

A couple of ppd's contain version numbers for the font files, update them
from 1.05 to 1.10

CLUSTER_UNTESTED

gs/contrib/pcl3/ppd/fonts.ppd
gs/lib/ghostpdf.ppd


2013-09-01 18:48:32 -0700
Ray Johnston <ray.johnston@artifex.com>
f89dd1d4d38db72a9fc7a605072cf2a419e6f190

Fix compiler warnings.

gs/base/gxclpage.c
gs/psi/imainarg.c
gs/psi/int.mak


2013-07-11 13:03:17 -0700
Ray Johnston <ray.johnston@artifex.com>
9c95a9ae56b5051ba8c7c3b3d161932678d3b01d

Enhance gx_saved_page and save_page function to support advanced functions.

By saving the device params in the saved_page struct we can use it more
generally to print pages out of order. This is still compatible with the
rendering of multiple saved pages on a 'master' page for imposition, but
the latter does not use the device params so pages with differing spot colors
or differing destination ICC profiles may be incorrect. To be fixed later.

Several utility functions support lists of saved pages: gx_saved_pages_list_new
to allocate and initialize a saved page list; gx_saved_pages_list_add to alloc
a new saved page object, fill it with the current page and add it to the end of
the list; gx_saved_pages_list_print to print various pages in various orders
from the list; gx_saved_pages_list_free to free the clist files for the saved
pages as well as the saved pages and the saved pages list and to support the
parameter and command line arg, gx_saved_pages_param_process. This function
may be useful for applications as well. See psi/imainarg.c for sample usage
with --saved-pages-test.

Also, the gx_device_printer get and put params have an added saved-pages string
parameter to allow control of this feature.

A new command line option --saved-pages="..." is added that will call the
'process' function. This is implemented for BOTH gs imainarg and plmain used
by the other languages. Also, --saved-pages-test is added for weekly testing
that will collect all pages in a list (--saved-pages=begin) then after the
file is processed, will print all pages (--saved-pages="print normal flush").

The capability is mentioned in doc/Use.htm, and the parameters for the control
string is documented in doc/SavedPages.htm

gs/base/gdevdflt.c
gs/base/gdevppla.c
gs/base/gdevprn.c
gs/base/gdevprn.h
gs/base/gsdparam.c
gs/base/gxclist.c
gs/base/gxclist.h
gs/base/gxclpage.c
gs/base/gxclpage.h
gs/base/gxclread.c
gs/base/gxclrect.c
gs/base/gxclthrd.c
gs/base/gxdevsop.h
gs/base/gxpcmap.c
gs/base/lib.mak
gs/base/string_.h
gs/devices/gdevijs.c
gs/devices/gdevp2up.c
gs/devices/gdevtsep.c
gs/doc/SavedPages.htm
gs/doc/Use.htm
gs/psi/imainarg.c
gs/psi/iminst.h
gs/psi/int.mak
pl/pl.mak
pl/plmain.c
pl/plmain.h


2013-06-11 22:04:00 +0200
zeniko <zeniko@gmail.com>
e7b7ecff0277c0aa7e162edd21842dc4409391ff

Bug 694121: prevent heap overflow

jbig2_decode_symbol_dict checks whether more glyphs are requested than
are available (SDNUMINSYMS + SDNUMNEWSYMS) but has so far failed check
whether there are more than expected (SDNUMEXSYMS); fixes
3324.pdf.asan.3.2585

gs/jbig2dec/jbig2_symbol_dict.c


2013-07-05 13:11:58 +0200
zeniko <zeniko@gmail.com>
f7064096ceac3d6c148096a936e1ea10fd8f0c55

Bug 694111: prevent heap overflow

jbig2_image_compose fails to ensure that the destination rectangle lies
entirely within the destination buffer (in the case of the file
3324.pdf.asan.50.2585, this happens due to a huge value for y). Adding a
new check which makes sure that...

@ y * dst->stride + leftbyte doesn't overflow
@ x and leftbyte don't overflow to the next line
@ h * dst->stride doesn't overflow
@ all values read are within the destination buffer

The file 3324.pdf.asan.50.2585 also demonstrates a memory leak where the
glyph isn't properly released if jbig2_image_compose fails.

gs/jbig2dec/jbig2_image.c
gs/jbig2dec/jbig2_text.c


2013-08-30 13:05:46 +0100
Ken Sharp <ken.sharp@artifex.com>
ca5a118174084f53893978d0c6b71d3a58db41bf

PDF interpreter - synthesize appearance for multiline text widgets

Bug 689761 "Multiline PDF form field does not honor line breaks"

There are several parts to this change. Firstly there was a bug in the code
to detect multiline text widgets, which meant that they were not detected
and instead of flagging a warning and ignoring the widget, we handled it
as if it were a single line. This also meant that we were mishandling combined
fields as tetx fields.

Secondly there is code in pdf-draw.ps which checks to see if we can synthesise
an appearance and if we can it ignores the one provided. Testing with Acrobat
indicates that this is what Acrobat does. However I think this is very wrong
and in testing our code I see about as many files which are better if we
use the appearance stream as are better if we manufacture one. So I've
chosen (for now at least) to use the appearance stream if we're given one.

Finally we now handle multiline text fields. The string is broken up into
multiple strings at the line breaks. The height of the rectangle is divided
by the number of strings, which allows us to space the lines evenly. We
detect and implement the different types of quadding. Note that Acrobat
does not seem to distribute the text the same way we do, but I don't see
any reason to try and mimic it.

Expected Differences
Bug689450.pdf Bug692968.pdf 1503_text_missing .pdf Bug690526.pdf Bug692591.pdf
these files have appearance streams that do not match up with the field values.
1783_CIDToGIDMap...pdf x_-_complex_fomr.pdf using the appearance stream
improves the output because our synthesis is not that great.
comb_and_password.pdf uses a combined field which we previously treated as
text, and which we now ignore.

gs/Resource/Init/pdf_draw.ps
gs/Resource/Init/pdf_ops.ps


2013-08-29 16:47:29 +0100
Robin Watts <robin.watts@artifex.com>
621b010d1a6e12f7754508fee8a860345b4f84df

Bug 694546: Fix undefined behaviour in gdevpbm.

Thanks to jsmeix for reporting this.

gs/devices/gdevpbm.c


2013-08-29 16:23:20 +0200
Tor Andersson <tor@ccxvii.net>
3659374423a9f7b0c4b361ce2e207549ae8b4e25

xps: Check sfnt name table length before accessing array.

Thanks to Shailesh Mistry.

xps/xpsfont.c


2013-08-27 16:03:41 +0200
Tor Andersson <tor@ccxvii.net>
30355133c04d2ab3f270a6ea6ee28ae8fa91021b

xps: Fix memory leak (bug 694469).

Thanks to Shailesh Mistry.

gs/base/gslibctx.c
pl/plmain.c


2013-08-27 16:01:33 +0200
Tor Andersson <tor@ccxvii.net>
8017a6b547e12bc43d16f1057ac5dbf075a47d1e

xps: Check for number of arguments when parsing abbreviated paths.

Thanks to Shailesh Mistry.

xps/xpspath.c


2013-08-27 15:45:09 +0200
Tor Andersson <tor@ccxvii.net>
9a85570458e46327dd8741c16c758669b5918ac4

xps: Avoid infinite loop on syntax errors in abbreviated path geometry.

Thanks to Shailesh Mistry.

xps/xpspath.c


2013-08-27 15:43:14 +0200
Tor Andersson <tor@ccxvii.net>
82fd60791f60a00bbd42b042198d0cc2593c0790

xps: Skip all but the first resource dictionary if there are many.

Thanks to Shailesh Mistry.

xps/xpspage.c
xps/xpsresource.c


2013-08-27 15:42:44 +0200
Tor Andersson <tor@ccxvii.net>
bac315e9d796bff6707e1b96e75d403edddf7303

xps: Ignore empty resource dictionaries.

Thanks to Shailesh Mistry.

xps/xpspage.c
xps/xpsresource.c


2013-08-23 16:17:55 +0200
Tor Andersson <tor@ccxvii.net>
d4d0e216d1327dab177820e2f90cbb2dd38843c6

xps: Check for missing pieces before dereferencing.

Should only be able to happen if .last.piece is missing.

Thanks to Shailesh Mistry.

xps/xpszip.c


2013-08-23 16:11:03 +0200
Tor Andersson <tor@ccxvii.net>
62c8ba4fa3af5fbe395cd4923766ca8a44fc36f1

xps: Check that Canvas.Resources has child node before descending.

Thanks to Shailesh Mistry.

xps/xpsanalyze.c


2013-08-23 16:08:37 +0200
Tor Andersson <tor@ccxvii.net>
8dc38533ab78a63c9c0a5c82ba96c45c0a9edebc

xps: Check the existence of stripbytecounts before using in TIFF decoder.

Thanks to Shailesh Mistry.

xps/xpstiff.c


2013-08-27 17:34:29 +0100
Ken Sharp <ken.sharp@artifex.com>
88bce110851c10455d3165ca748a3371d9c917cc

PostScript interpreter - make setpagedevice and EndPage work more like Adobe

Bug 690667 "Changing PageSize during n-up processing by BeginPage/EndPage generates wrong output"

The test job changes setpagedevice during the course of the job, and the
EndPage takes special action depending on the page count. The first problem
is that we don't reset the count of pages in the device, and Acrobat can
be shown to do so on *any* call to setpagedevice (even if the dictionary
is empty). In zsetdevice() we now reset the page count in the current device
so that he page count is reset, even if the device doesn't change.

Secondly we call .trysetparams before we execute the EndPage routine (if
present). The problem here is that .trysetparams actually modifies the
page device dictionary (and hence the device) and so attributes can change
before the EndPage, in particular the PageSize. The /setpagedevice routine
has been modified to move the execution of EndPage much earlier in the
process. Again testing with Adobe Acrobat shows that the EndPage procedure
is executed if the dictionary argument is empty, and indeed even if the
execution of setpagedevice causes an error.

No differences expected. Note this is a potentially destabilising change.

gs/Resource/Init/gs_setpd.ps
gs/psi/zdevice.c


2013-08-27 15:55:07 +0100
Ken Sharp <ken.sharp@artifex.com>
07ed0d0cb0de6ebc456a08ca0484c0e8a120b472

PDF interpreter - clamp invalid numbers to 0 in Shading Coords

Bug 694542 "Ghostscript failed to convert pdf file to images"

The specimen file contains invalid numbers in the Coords array of every
Shading dictionary. Acrobat (of course) handles this by silently converting
all such numbers to 0.

This commit checks the Coords of the Shading, and if any entry is not a number
(our token parser converts invalid numbers to names) it replaces it with a
xero.

No differences expected

gs/Resource/Init/pdf_draw.ps


2013-08-27 13:20:03 +0100
Chris Liddell <chris.liddell@artifex.com>
e413f6aa426fb63c2e9709ad8d28ab862bc1d44d

Add the font embedding paragraph.

The URW+ fonts are licensed under the GPL, with an additional allowance
for embedding the fonts, and that embedding not affecting the license of
the document in which the font is embedded.

CLUSTER_UNTESTED

gs/LICENSE


2013-08-27 11:21:37 +0100
Ken Sharp <ken.sharp@artifex.com>
8b6be8be2cdcefae39339682d45d3c009ab909ac

pdfwrite - more discriminating tests before TrueType font combining

Bug 694538 "Incorrect embedding of fonts"

The test file does not appear to be the regular output of the MS Windows
PostScript driver, it looks like several files have been stripped and then
added together. A process liable to failure at the best of times.

In this case we end up with a large number of incrementally downloaded,
subset, TrueType fonts. Despite the fact that these are the same font and
in many cases contain the same, or compatible, subsets the fonts are
downloaded several times, which is why I believe this to be a combination
of separately created files.

pdfwrite tries to combine such fonts, and does so quite succcesfully in
this case. However, the individual fonts are not all alike. Some information
in the TrueType table is clearly copied from the original font (eg the
numGlyphs value of 3147) and some is not. In particular the maxPoints
value differs between two otherwise compatible subset fonts (one has additional
glyphs). It seems Acrobat doesn't like this, it sometimes raises an error
and does not display any glyphs whose point count exceeds the maxPoints
value.

This commit adds the maxPoints and maxContours values to the gs_type42_data
structure and tracks them. Fonts are not now considered compatible if
these values are different between them.

This will lead to less font merging, but for sensibly created programs
this will not be a problem, as the driver only downloads the font once. For
programs created by jamming files together it will prevent the situation
where we create a font which Acrobat cannot read.

No differences expected.

gs/base/gstype42.c
gs/base/gxfont42.h
gs/devices/gxfcopy.c


2013-08-26 14:31:28 +0100
Chris Liddell <chris.liddell@artifex.com>
e9b47527ec10d911f8154c60f746985e139606b8

Bump version number

gs/Resource/Init/gs_init.ps
gs/base/version.mak


2013-08-30 10:00:41 +0100
Chris Liddell <chris.liddell@artifex.com>
7fcadf3b8b0ef1662419c15b8d51e36e434804be

Update product string, dates and docs for 9.10 release.

gs/base/gscdef.c
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2013-08-29 16:47:29 +0100
Robin Watts <robin.watts@artifex.com>
b8d4701f17205624ebffe3d4630c9df87ac095b0

Bug 694546: Fix undefined behaviour in gdevpbm.

Thanks to jsmeix for reporting this.

gs/devices/gdevpbm.c


2013-08-27 13:56:35 +0100
Chris Liddell <chris.liddell@artifex.com>
0680e46d927d1cc02a4bad4c3a90cb9adc3d4580

Bring docs up to date for RC.

gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2013-08-26 14:29:57 +0100
Chris Liddell <chris.liddell@artifex.com>
466d8f67a5b1ada99d05777ba33fab48a7d74bc9

Change product string for release candidate

gs/base/gscdef.c



Version 9.10 (2013-08-27)

This is the ninth full release in the stable 9.x series, and is primarily a maintenance release.

Highlights in this release include:

For a list of open issues, or to report problems, please visit bugs.ghostscript.com.

Incompatible changes

No recorded incompatible changes.

Changelog

2013-08-29 16:47:29 +0100
Robin Watts <robin.watts@artifex.com>
b8d4701f17205624ebffe3d4630c9df87ac095b0

Bug 694546: Fix undefined behaviour in gdevpbm.

Thanks to jsmeix for reporting this.

gs/devices/gdevpbm.c


2013-08-26 14:29:57 +0100
Chris Liddell <chris.liddell@artifex.com>
466d8f67a5b1ada99d05777ba33fab48a7d74bc9

Change product string for release candidate

gs/base/gscdef.c


2013-08-25 20:52:36 -0700
Ray Johnston <ray.johnston@artifex.com>
4a319086dd71dbcc3ec71b70277734595647784d

Fix bug 694539. Reading off the end of the cbuf when dash pattern len is max.

The max length dash pattern (currently 11) was used frequently in this file,
and in at least one case, this tripped over a memmove that is way too large in
the top_up_cbuf because the pointer was past the end of the buffer, and the
unsigned int count was 0xffffffff. The root cause was that the cmd_largest_size
used to set the warn_limit did not account for both the dot_length and the
offset.

I corrected cmd_largest_size, added some comments, and added an error message
and ioerror return to top_up_cbuf.

gs/base/gxcldev.h
gs/base/gxclrast.c


2013-08-24 10:36:20 +0100
Ken Sharp <ken.sharp@artifex.com>
2001f469b539a5ccce301ace5d6384b6b7e46888

Fix -dUseCIEColor (part of the whole VM allocation problem)

See commit ae930279498a5961fcf5d70ffe86864883609cbc for a lengthy explanation)
of the background to this problem.

The fix for the original problem involved always creating the device dictionary
for setpagdevice in local VM.

Following on from that we discover the following in zdsp1.c

gstate_check_space(i_ctx_t *i_ctx_p, int_gstate *isp, uint space)
{
/*
* ****** WORKAROUND ALERT ******
* This code doesn't check the space of the non-refs, or copy their
* contents, so it can create dangling references from global VM to
* local VM. Because of this, we simply disallow writing into gstates
* in global VM (including creating them in the first place) if the
* save level is greater than 0.
* ****** WORKAROUND ALERT ******

Now, if we execute the Display PostScript .savelocalstate routine, its vital
that the gstate and all its contents be in global VM in order to satisfy
the test in zdps1.c.

So, any calls to setpagedevice before the call to .savelocal must allocate
the page device dictionary in global VM (as a pointer to the device dictionary
is saved in the gstate)

Thus we need a way to tell setpagedevice to allocate its dictionary in global
VM, even though we usually want it in local VM.

This commit adds a somewhat hacky method for this, we insert a specific key
/..StartupGlobal in the page device dictionary. If setpagedevice finds this
key in the dictionary we allocate the dict in global VM, and remove the key.

We then use this key in a couple of places in gs_init.ps where we execute
setpagedevice *before* we've reached .savelocalstate.

This fixes all the myriad problems with allocation states and gives us a way
to add any more that are required.

I've put a comment into gs_init.ps immediately before /.savelocalstate so
at least in the future it will be easier to figure out where this is required.

I've searched all the initialisation files looking to see if there are any
other likely places (the INITFILES string is parsed before we get to
.savelocalstate) and they all look acceptable. None of the routines actually
execute setpagedevice.

No cluster differences expected as none of this is tested

gs/Resource/Init/gs_init.ps
gs/Resource/Init/gs_setpd.ps


2013-08-23 09:15:32 +0100
Ken Sharp <ken.sharp@artifex.com>
c1510d726063080559e9597db7d4a686f2ca4eae

correct some typos in PDFDocEncoding to UTF8 conversion

Bug #694535 "Typo in charset conversion in gdevpdfe.c"

Credit (and thanks) to Tim Waugh at Red Hat for the fix, applied here.

No differences expected, we clearly don't have any examples that exercise
this particular case in our test suite.

gs/devices/vector/gdevpdfe.c


2013-08-23 08:42:46 +0100
Ken Sharp <ken.sharp@artifex.com>
ae930279498a5961fcf5d70ffe86864883609cbc

More work related to VM mode, setpagdevice and startup conditions

This has a lengthy bug tail attached to it, the summary follows, prior
commits of interest are (ordered by date, earliest first):
073f7be1671e7fa2dbbc75984e593d2279bb05d7
939e32ff3c8841507aed80435269457f3caac6f5
774231a7db63439c72313050a750b219491c172f
39b494d41a814e6b27a5828030e58e0b239044fb

Initially the bug report was #687702 "gs8.15 setpagedevice /invalidaccess",
the problem was caused by a 'fix' for WordPerfect files which assumed a local
VM writeable dictionary returned by currentpagedevice. The fix was to create
a local VM copy of the dictioanry, because its acceptable to store global
objects in local VM, but not vice versa. (073f7be1671e7fa2dbbc75984e593d2279bb05d7)

However, if we start with -dSAFER then, quite early in gs_init.ps, we call
/.setsafe (which called /.locksafe) which ends up executing setpagdevice
in order to set /LockSafetyParams. This causes the page device dictionary to
be allocated in local VM. This should not cause any problems, but.....
setpagedevice stores a pointer to the returned dictionary in the graphics
state, the Display PostScript initialisation code insists that all objects
in the 'savedinitialgstate' be in global VM, and we just allocated the dict
in local VM, so we get an error.

This was fixed in setpagedevice by checking for a 1 element dictioanry
with the specific key '/LockSafetyParams', and creating a global VM dict
instead of a local one. (939e32ff3c8841507aed80435269457f3caac6f5)

We then discovered that GSView sends PostScript containing '.locksafe',
which triggers the check in sepagedevice and sets the VM allocation mode
to global, causing an invalidaccess error. GSView should not be using
undocumented internal routines but it was decided to fix this, even though
a release had just been completed. This was done by creating a new routine
'.locksafeglobal' which sets a key called /LockSafetyParamsGlobal and
having setpagedevice check for that key, if discovered it creates a global
VM dictionary and replaces the key with /LockSafetyParams. Finally /.locksafety
was returned to its original state. (774231a7db63439c72313050a750b219491c172f)

A new release was completed, and it then transpired that, despite having
tested gv briefly, under certain conditions it executes a script (pdf2dsc)
which uses pdf2dsc.ps, which calls .setsafe. This didn't seem terribly
important and so the line was removed from the PS file.

Ray pointed out that the .setsafe routine is (minimally) documented in
use.htm, and it seems is important to the Unix community because of the
'SAFER' switch. So this commit restores /.setsafe (and the line in pdf2dsc.ps)
and creates a new /.setsafeglobal. This is *only* executed in gs_init.ps,
its presence is solely for the benefit of DPS so that the initial gstate
is allocated in global VM, and must not be used anywhere else.

Hopefully we can finally say goodbye to all this mess now.

gs/Resource/Init/gs_init.ps
gs/lib/pdf2dsc.ps


2013-08-22 16:07:29 +0100
Ken Sharp <ken.sharp@artifex.com>
39b494d41a814e6b27a5828030e58e0b239044fb

remove a '.setsafe' from the PS file it doesn't work any more and nobody
should be using undocumented internal routines anyway.

We should probably remove pdf2dsc altogether, it relies on using parts
of the PDF interpreter which, as far as I'm concerned, are subject to
change without notice.

gs/lib/pdf2dsc.ps


2013-08-22 13:33:14 +0100
Ken Sharp <ken.sharp@artifex.com>
dfd7fc9fe152245256e437141dd7780c8313c971

pdfwrite - make the saved gstate stack dynamically allocated instead of static array

Bug #693591 "Infinite loop writing pdf file"
Bug #694531 " "*** File has unbalanced q/Q" infinite loop on seemingly valid file"

The stack of saved gstates in pdfwrite was a statically allocated array of 11
elements. Cairo produces PDF files with insane (and pointless) levels of
Form XObject nesting which can easily break this limit (as well as causing all
PDF consumers to render the files slowly)

This commit replaces the fixed size array with a dynamically allocated array.
For performance reasons we still allocate 11 elements initially, and if we
exhaust the storage, we reallocate 5 elements larger.

This also shows a progression in the test file 'inefficient_tiling.pdf' this
file is produced by LaTeX but I guess it may be using Cairo behind the
scenes.

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfx.h


2013-08-16 10:35:58 +0100
Chris Liddell <chris.liddell@artifex.com>
868bcc0c697619a276e725fd851b5f52079e64a5

Bring master up to date with 9.09 release branch

update docs, version numbers, dates and product string

Update product string, dates and changelog for 9.09 release.

No cluster differences.

gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2013-08-21 14:26:57 +0100
Ken Sharp <ken.sharp@artifex.com>
243c299262d0e5ebac46f517e749a3d45cbe9c46

Fix a compiler warning which exhibited a real problem

In gdevpdfp.c remove a redefinition of 'code'. The 'for' loop uses the
outer definition of 'code', but the inner definition is set by
cos_dict_put_c_key_string() This means that the inner definition is never
used, and the outer one used to control the loop is never changed, defeatimg
the purpose.

The other new compiler warnings in pdfwrite are either not valid (some warnings
are incorrect) or benign and fixing them introduces other warnings.

gs/devices/vector/gdevpdfp.c


2013-08-21 13:23:52 +0100
Ken Sharp <ken.sharp@artifex.com>
077435083eb0d8acb91686ba8b745ec8371e16fd

Correct the evaluation order in filenameforall processing

gs/base/gp_ntfs.c


2013-08-21 10:13:59 +0100
Ken Sharp <ken.sharp@artifex.com>
735589e5b16cf3d31c6bf73ebd75259db9d18f3c

Yet more work on NTFS file enumeration

Bug #686853, SaGS comment #9

We now match the pattern template only at the top level of the recursion,
any directories which match the pattern are enumerated, but their entire
contents are listed.

Multiple path separators are now removed at each level. It should now be
impossible to reach a situation where a returned file has '\/' or similar
contained within it.

Illegal characters ('*' and '?') in the path will now cause no matches to
be returned. These are of course valid after the final separator of the
path and will match filename patterns at that level.

I've checked this with various paths utilising multiple path separators,
mixed use of separators, illegal escaped characters in the path and a modest
variety of patterns. All this with COMPILE_INITS=0 and COMPILE_INITS=1 and
in both cases with GS_NO_UTF8=1 and without specifying GS_NO_UTF8. All seems
to be OK in all cases. None of this is tested by the cluster of course.

CLUSTER_UNTESTED

gs/base/gp_ntfs.c


2013-08-20 10:21:09 +0100
Chris Liddell <chris.liddell@artifex.com>
b0c3a494395db460cbb8e28a6896eebccc6b797a

Ensure we don't overflow the filename buffer.

No cluster differences.

gs/base/gp_unifs.c


2013-08-20 10:23:02 +0100
Ken Sharp <ken.sharp@artifex.com>
c1544d825be1f87ed0821ef0163d08595b5fc0e6

Make the Windows implementation of filenameforall match the Unix version

The Unix version of filenameforall starts in the current working directory
when no directory is specified.

When the pattern length exceeds the available string we should return a
rangecheck error, not an empty string.

When the filename exceeds the available string we should return a
rangecheck error, not a truncated string.

CLUSTER_UNTESTED

gs/base/gp_ntfs.c


2013-08-19 15:06:12 +0100
Ken Sharp <ken.sharp@artifex.com>
d6921b5c5ab2af44c48e0084e4a31bcd7512f183

Allow use of '\\' for filenameforall and friends on Windows

The commit to allow recursive directory enumeration f13bfba removed the
code which translated '\\' into '\', which could lead to incorrect filenames
being returned.

This fix restores that functionality, but we still think everyone would be
better advised to use the PostScript '/' separator instead, which works as
well as '\' does.

CLUSTER_UNTESTED

gs/base/gp_ntfs.c


2013-08-18 21:05:00 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
613554e16d315c8db89653775c1fdcf682f238fe

Add quotes around values for a conditional for VS build.

CLUSTER_UNTESTED

main/pcl6_msvc.mak


2013-08-16 14:00:43 +0100
Ken Sharp <ken.sharp@artifex.com>
7d93cf893d1d2fac826e3c5f81ea92123425216e

Address gp_wgetv not finding *any* environment variables unless compiled with GS_NO_UTF8

The string being passed in as the 'name' was a regular 1 byte C char array.
But _wgetenv expects to be given a wide character string to find and
treats the argument as such. This mean environment variables never matched.

This commit mimics the code for the registry variables, and converts the
name to a wchar before passing to _wgetenv.

CLUSTER_UNTESTED

gs/base/gp_wgetv.c


2013-08-02 09:32:00 +0100
Chris Liddell <chris.liddell@artifex.com>
ae09189f11f59c2d350cca820c880cd48a0657d0

Fix a couple of very minor UFST build issues.

Automatically drop the default Truetype fonts if we're integrating the UFST
(with it's attendant MT fonts).

No cluster differences.

main/pcl6_gcc.mak
main/pcl6_msvc.mak


2013-08-16 12:47:36 +0100
Chris Liddell <chris.liddell@artifex.com>
e67e098fa0b5bf7570453c15ccc98fabf1e561dc

Fix GS_NO_UTF8 build problem with gs_sprintf.

CLUSTER_UNTESTED

gs/base/gp_wgetv.c


2013-08-16 07:58:57 +0100
Ken Sharp <ken.sharp@artifex.com>
774231a7db63439c72313050a750b219491c172f

PS Interpreter - yet more meddling with VM allocation and setpagedevice

Bug #694525 "GSView 5.0 does not work with GPL Ghostscript 9.08"

Rather horrifyingly GSView uses undocumented internal operations of
Ghostscript. In this case the changes to VM allocation mode during setpagedevice
were being circumvented.

This commit changes the way we detect a setpagedevice during startup, previously
we check that the dictionary contained one key called /.LockSafetyParams
and if so assumed that this meant we were in startup, so we set the VM
allocation mode to global for the benefit of Display PostScxript.

GSView ended up triggering that test, which caused a VM allocation error.

We now look for the key /.LockSafetyParamsGlobal instead. If this is present
we set the VM allocation mode to global and *replace* the key with
/.LockSafetyParams instead. This allows accurate detection of the startup
condition.

No differences expected, GSView 5 seems to work and the original bug still
is fixed.

gs/Resource/Init/gs_init.ps
gs/Resource/Init/gs_setpd.ps


2013-08-15 19:56:59 +0100
Chris Liddell <chris.liddell@artifex.com>
4be79a96fe22c988cc4d9edfedac75e6f46e15fa

Bump version number.

The usual cluster differences.

gs/Resource/Init/gs_init.ps
gs/base/version.mak


2013-08-15 16:53:17 +0100
Robin Watts <robin.watts@artifex.com>
43e4db79a40b2ac73eac2bf3732f2e2dcc122d12

Update special antidropout downscaler code.

In hunting for bug 694451, it looked like the problem was in the
special antidropout downscaler for a while, but this turned out
not to be the culprit.

Nonetheless, the code had not been updated to take advantage of the
'Active' region optimisations, so we do that here.

gs/base/sidscale.c


2013-08-15 16:09:24 +0100
Chris Liddell <chris.liddell@artifex.com>
f86ac4209753ea0e9e06a9f4c22a19a8447b5fb5

Some chenges fed back from customer #661 and.....

some function naming tidy ups I've been meaning to do for some time.

The changes from #661 make the code a bit more flexible for different
configurations of the font rendering library.

No cluster differences.

gs/base/fapi_ft.c
gs/base/fapiufst.c


2013-08-15 09:06:30 +0100
Ken Sharp <ken.sharp@artifex.com>
6ba5abfa7325ae980bba37fdc71582eeca152a87

update caption.ps so that it does not mark the page on device deactivation

Bug #694517 "additional page with caption.ps"

The EndPage procedure in caption.ps marks the page in the file with the
defined caption regadless of the reason code for the EndPage. This means
that it marks the page even on device deactivation.

Since commit 3894e9c8a3ab125c82048da3bf81515500bb2da0 pdfwrite will emit
pages that are marked, even if no showpage is executed (this is to match
observed Acrobat Distiller behaviour) and this means that an extra 'blank'
page is emitted on device deactivation.

This commit simply modifies caption.ps so that it only writes the caption
if the reason for calling EndPage is *not* device deactivatyion.

gs/lib/caption.ps


2013-07-31 07:45:02 +0100
Chris Liddell <chris.liddell@artifex.com>
a65df0454d1a8de06d2d342100408482c9ec101b

Bring master up to date with 9.08 release branch.

Change product string for release candidate.

No unexpected cluster differences.

Update version and product strings for release candidate.

Update news and history for 9.08 release.

Update release date for 9.08 release.

gs/base/gscdef.c
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1
gs/psi/winint.mak


2013-08-14 16:42:49 +0100
Robin Watts <robin.watts@artifex.com>
c07d6c816052686d29efdee5e94567066baaf75a

Remove stray cluster products.

These should never have been committed.

clustercmd
clusterdatestamp


2013-08-14 08:59:31 +0100
Ken Sharp <ken.sharp@artifex.com>
2c369110313fda917820faf3657dee55158b538b

PS Interpreter - populate the /OutputDevice resource

Bug #689500 "/OutputDevice category is empty"

This commit uses the devices built into the executable to populate the
/OutputDevice resource. The bug thread suggests using devicedict but we
can't do that in gs_res.ps because it isn't set up until later. So we
duplicate the code used to populate devicedict.

According to the PLRM the only required member of the OutputDevice resource
instance is the PageSize, I've chosen to copy the same values as Adobe Acrobat
Distiller, but these can be changed if this proves to be a limitation.

Two additional changes were required, exposed by the Quality Logic test file
09-59.ps

In gdevdevn.c devn_get_params() it is possible for the function to be called
with pequiv_colors set to NULL, this caused a seg fault. Modified the code
so that it doesn't attempt to dereference a NULL pointer.

The file 09-59.ps uses setpagedevice to set each possible instance of the
OutputDevice resources, this can cause problems with some devices as it
doesn't actually send a file. In particular with the mswinpr2 device on
Windows, but it also caused errors on Linux. Since this is a CET file,
gs_cet.ps was modified to delete the OutputDevice resource category and
create a new empty one.

Expected Differences
430-01.ps enumerates all the entries in /OutputDevice and so has a *lot*
more data to print.

gs/Resource/Init/gs_cet.ps
gs/Resource/Init/gs_res.ps
gs/base/gdevdevn.c


2013-08-13 00:04:57 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b89761f06d297f8555f346e9c0a7850fc549c668

Fix for problem with double application of alpha when composing isolated groups.

gs/base/gxblend1.c


2013-08-13 13:48:52 -0700
Ray Johnston <ray.johnston@artifex.com>
6c7d9d1191ed4afad16f7bc4089a43bb18190a96

Fix bug 694514. Don't use clist HL images in pattern-clist when interpolated.

Since patterns that are put in the clist are large, interpolating multiple
times for every band intersected by the pattern can kill performance.

clustercmd
clusterdatestamp
gs/base/gxclimag.c
gs/base/lib.mak


2013-08-13 15:30:55 +0100
Chris Liddell <chris.liddell@artifex.com>
d7c310e59953aacdeb642ce202c0911071a80d31

Bug 694513: force chars to signed on AIX with Luratech

The Lutatech JBIG2 decoder requires signed chars, so add the requisit flags for
for the Luratech build to ensure that happens.

No cluster differences.

gs/configure.ac


2013-08-09 17:02:40 -0700
Ray Johnston <ray.johnston@artifex.com>
e9f0f0eb05ee0abea13deabab6617d20e1913e83

Fix bug 694455. Incorrect CTM when rendering SMasks.

The clippath was incorrect due to the CTM. As specified in 7.5.4 of the PDF spec:

The mask's coordinate system is defined by concatenating the transformation
matrix specified by the Matrix entry in the transparency group's form dictionary
(see Section 4.9.1, "Form Dictionaries") with the current transformation matrix
at the moment the soft mask is established in the graphics state with the gs
operator.

This fixes the customer's file and also results in a progression on
comparefiles/Bug693681.pdf where extra data was previously showing.

gs/Resource/Init/pdf_draw.ps


2013-08-09 16:00:23 +0100
Ken Sharp <ken.sharp@artifex.com>
e72c03d49e6c0e107afa32b5b2b8a6cf9d43b663

PDF Interpreter - undo commit 946f63b5748a5a19c369a1d42e653c69cd57075e

Marcos wants to have files produce an error, so we don't run them in a
stopped context any more.

In fact it appears that later work means none of these files exit the
interpreter on error any more, they do produce PostScript error messages
though.

1305_-_crypt_filter_length_ignored.pdf.pdf
1479_-_does_not_render.pdf
1931_-_crypt_version_5_revision_6.pdf
692248_-_recursive_ObjStm_ref.pdf
692248_-_wrong_ObjStm_ref.pdf.pdf
694313_-_double-free_during_reparation_fails_.pdf
694313_-_empty_xref.pdf
Adobe_LiveCycle_DRM_protection_sample_Adobe.APS_-_adbe.pdrl.v0_fails_.pdf
MSVR_176_-_missing_range_check_in_pdf_repair_fails_.pdf
MSVR_201_-_missing_CIDSystemInfo.pdf
annotations_without_font.pdf
double_indirect_reference.pdf
huge_cmap_values.pdf
recursive_indirect_reference.pdf
recursive_outline.pdf
repairing_leaks_object.pdf
x_-_SumatraPDF1.1DOS.pdf


all now produce errors again

gs/Resource/Init/pdf_main.ps


2013-08-09 15:15:53 +0100
Chris Liddell <chris.liddell@artifex.com>
44800428c346804af98b1d9b2e86b6d8e61b858b

Delete the ._.DS_Store .DS_Store files.....

which cause problems decompressing release archives on OS X.

gs/lcms2/Projects/mac/.DS_Store
gs/lcms2/Projects/mac/._.DS_Store


2013-08-09 13:50:19 +0100
Ken Sharp <ken.sharp@artifex.com>
010e9990d734a8a2361663338b1fbd605d0ca052

PDF interpreter and pdfwrite - better handling of Outlines and Dests

Bug #690253 "'pdfmark destination page' error while splitting a PDF: confusing output and invalid links."

Several parts to this, we had already removed the 'ERROR' from the message
emitted when a DEST or OUT pdfmark pointed to a page outside the valid range.

This commit makes pdfmark produce an error when an Outline has an invalid
range (DEST laready did). We also wrap pdfmark invocations in 'stopped' so
that we can trap the error. This allows us to elide Links and Outlines to
invalid pages (previously the links remained, but did nothing useful).

Since the bug was raised, we now also use the '%d' syntax to split PDF
files. This would still produce invalid links, because the page number
would not be invalid.

We now check the OutputFile when opening a PDF file, and if it contains
'%d' we set a couple of flags which will skip Outline and Dest link creation
as these would never be correct.

gs/Resource/Init/pdf_main.ps
gs/devices/vector/gdevpdfm.c


2013-08-08 08:50:23 +0100
Ken Sharp <ken.sharp@artifex.com>
a850d6c6d14f3a40bb8d40e471bf4822ead8580d

PDF Interpreter - update to 073f460af5bb37edb1849c5d6235048598100437

Bug #694508 "Regression: error writing PDF file starting with
72b397ecb4f5be3fdbf6da4a90a306d259ec3e93"

The commit 073f460af5bb37edb1849c5d6235048598100437 had an error in the
handling of named actions, which I didn't previously have a test case for.
NB the commit in the bug title is incorrect, I'm not clear on why Marcos
thought this was the commit which introduced the error.

This commit fixes that and allows me to test the named actions, which now
work correctly.

gs/Resource/Init/pdf_main.ps


2013-08-07 13:18:16 +0100
Ken Sharp <ken.sharp@artifex.com>
073f460af5bb37edb1849c5d6235048598100437

PDF interpreter - improve handling of pdfmarks when we have multiple input files

Bug #688542 "Bookmarks Get Lost In PDF"
Bug #688829 "Merging PDF files using gs: outlines and links not updated"

The pdfmarks generated by the PDF interpreter for Outlines and Links use the
page number relative to the start of the current input file. For single
input files this works fine, but when we have multiple input files, we end
up with outlines and links pointing to the wrong place.

To resolve this we need to know, at the start of any PDF file, how many pages
have already been processed, and then we will add this value to the nominal
page number when creating the pdfmarks.

Hin-Tak provided a solution (#688829) that used globaldict, which Alex rejected
for that reason. This commit executes currentpagedevice at the start of every
PDF input file, and stores in in /CumulativePageCount. We can then use this
to generate pdfmarks which are correct.

Even if PDF and PostScript input files are mingled, the PDF-generated pdfmarks
will still be correct.

We won't make any attempt to correct PostScript input, if you are creating a
PostScript program, you should get it right. If you really must merge, then
use pdfwrite to create the individual PDF files, and then merge those.

It is possible that other types of generated pdfmark will need similar
alteration, we'll tackle those as they turn up.

gs/Resource/Init/pdf_main.ps


2013-08-05 17:42:53 +0100
Ken Sharp <ken.sharp@artifex.com>
22e66c90bf173e4787717137a25833b4aa823993

PDF interpreter - increased checking of Outlines, to avoid errors

Bug #694503 "Regression: output pdf file blank starting with 0c8150ab6b2b8ceaa17cc1b1933d523764ffe114"

After attempting to recover from broken objects, it was possible to
throw an error when processing Outlines, because the recovered object
was of the wrong type. This could cause PDF files with broken /Outlines to
fail with pdfwrite, where previously they would write a file, but drop the
/Outlines. (this only occurs wiht pdfwrite, because we ignore Outlines
when rendering)

This commit restores the previous behaviour by checking the type of the returned
object.

gs/Resource/Init/pdf_main.ps


2013-08-05 13:46:02 +0100
Ken Sharp <ken.sharp@artifex.com>
72b397ecb4f5be3fdbf6da4a90a306d259ec3e93

PDF interpreter run .reusablestreamdecode in 'stopped' to handle errors

Bug #694437 " Infinitely many warnings: **** File has unbalanced q/Q operators (too many Q's) ****"

The infinite recursion is due to not updating the current file position, and
rerunning the same code, which results in the same error.

To handle this we wrap the exeuction of reusablestreamdecode in a 'stopped'
context, so that we cna capture the error, and move the file pointer as
required. The job still throws warnings, but the resulting PDF is the same
as displayed by Acrobat with the original file.

gs/Resource/Init/pdf_draw.ps


2013-08-02 22:26:09 +0100
Chris Liddell <chris.liddell@artifex.com>
dc77b50bdb6abe88446dc7cdb9d7bd77a90dbfea

Bug 694502: reverse of dictomark for PDFs

The order with which the key/value pairs in a <<>> (apparently) differs between
Postscript and PDF. Postscript pushes the objects onto the stack, then pops
them in pairs, so the order is reversed compared to the order they were
encountered. PDF handles them in the order they were encountered.

This is, of course, only a problem when there are duplicate keys.

Thus in PS "<< /a 1 /a 2>>" the key "/a" ends up with the value "1". In PDF, "/a" gets
the value "2".

No cluster differences.

gs/psi/int.mak
gs/psi/zdict.c


2013-08-02 16:51:33 +0100
Ken Sharp <ken.sharp@artifex.com>
d22c7a5b454ca8e021eb6b71c87627bfb8546edb

Improve use of stopped to guard against PDF interpreter exit

Improvements to commit 946f63b5748a5a19c369a1d42e653c69cd57075e:

1) Add an error message so that the file does not silently fail to process.

2) Check PDFSTOPONERROR and do not run in a stopped context if this is set.

gs/Resource/Init/pdf_main.ps


2013-08-02 15:13:18 +0100
Ken Sharp <ken.sharp@artifex.com>
946f63b5748a5a19c369a1d42e653c69cd57075e

run PDF files totally in a stopped context to prevent interpreter exit on error

What it sys on the tin..... Several recent bug reports cause the interpreter
to exit if it provokes a PostScript error. Running the PDF file in a stopped
context prevents that from happening.

Bug #694472, but many others up to #694449 are affected similarly.

gs/Resource/Init/pdf_main.ps


2013-08-02 11:15:09 +0100
Ken Sharp <ken.sharp@artifex.com>
709c87fb7837993cb96eaa508c66381c1696ebdf

add extra error checking of the Trailer dictionary

Bug #694474 the file is badly damaged, and Acrobat won't open it. The only
problem from our perspective is that the error generated causes the
interpreter to exit (because there is no Trailer dict). Added more checks
before use to ensure we don't generate errors with missing (empty) trailer
dictionaries.

A number of other files no longer cause errors when run with the cluster.

gs/Resource/Init/pdf_main.ps
gs/Resource/Init/pdf_rbld.ps


2013-08-02 09:39:17 +0100
Ken Sharp <ken.sharp@artifex.com>
0c8150ab6b2b8ceaa17cc1b1933d523764ffe114

Attempt to handle broken object definitions (garbage on stack)

If we have certain kinds of broken object definitions we can end up with
more than one object on the stack when we encounter an endobj (or a new
object definition before encountering an endobj for the previous object).
Previously we would throw an error and ignore the object (define it as null)
now we attempt to recover by removing objects from the stack until we have
a stack of the form 'n n object' where the 'n' represents an integer.

The bug #694443 now runs to completion although the output is empty. Given
how badly broken this file is I don't propose to do any more with it.

gs/Resource/Init/pdf_base.ps


2013-07-31 15:09:47 +0100
Ken Sharp <ken.sharp@artifex.com>
2667fbaa1c6c5ba84acc04ccc5b7b97723c09ad1

PDF interpreter - remove lower limit on PDF files, improve broken file handling

At some time in the past we set a lower limit of 400 bytes for PDF files,
regarding anything less as invalid. While this may or may not be true, it
prevents us repairing broken files that small. Removed the limit.

When repairing a broken xref, we attempt to use the last startxref to find
the tgrailer dictionary. If the startxref is followed by anything other than
an integer we should ignore it.

These both arise from Bug #694443 "/undefined in xref". The bug is not fixed
because the file exhibits still more faults.

Expected differences:
The files 694317_-_minimal.pdf, broken_EOF_object_overwrites_good_object,
missing_endobj_swallows_following_obj and missing_page_tree.pdf no longer
produce errors.

gs/Resource/Init/pdf_main.ps
gs/Resource/Init/pdf_rbld.ps


2013-07-31 07:41:57 +0100
Chris Liddell <chris.liddell@artifex.com>
91a5d41eb1fea65adb1110ffa2a3b769263b7635

Bump version for pending release.

No unexpected cluster differences

gs/Resource/Init/gs_init.ps
gs/base/version.mak


2013-08-21 14:15:15 +0100
Chris Liddell <chris.liddell@artifex.com>
952b06580b96045a6b052af9a1842d9f770ccd1b

Update product string, dates and changelog for 9.09 release.

gs/base/gscdef.c
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2013-08-20 10:21:09 +0100
Chris Liddell <chris.liddell@artifex.com>
ba1dedf24849295e107df180a291eba99bb33531

Ensure we don't overflow the filename buffer.

No cluster differences.

gs/base/gp_unifs.c


2013-08-20 10:23:02 +0100
Ken Sharp <ken.sharp@artifex.com>
36088d57f45958b3647b21f5ee3908377f113682

Make the Windows implementation of filenameforall match the Unix version

The Unix version of filenameforall starts in the current working directory
when no directory is specified.

When the pattern length exceeds the available string we should return a
rangecheck error, not an empty string.

When the filename exceeds the available string we should return a
rangecheck error, not a truncated string.

CLUSTER_UNTESTED

gs/base/gp_ntfs.c


2013-08-19 15:06:12 +0100
Ken Sharp <ken.sharp@artifex.com>
167ca10abb0a90c4a28a381223afd6fb80347282

Allow use of '\\' for filenameforall and friends on Windows

The commit to allow recursive directory enumeration f13bfba removed the
code which translated '\\' into '\', which could lead to incorrect filenames
being returned.

This fix restores that functionality, but we still think everyone would be
better advised to use the PostScript '/' separator instead, which works as
well as '\' does.

CLUSTER_UNTESTED

gs/base/gp_ntfs.c


2013-08-16 10:35:58 +0100
Chris Liddell <chris.liddell@artifex.com>
36c5b40dd44d7ef8de4aeba40c5d6c817882b594

update docs, version numbers, dates and product string

gs/Resource/Init/gs_init.ps
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2013-08-16 10:26:47 +0100
Chris Liddell <chris.liddell@artifex.com>
e1c028424f6900412241c076f11f4d9f2409cdb0

Set product string for release candidate 1

gs/base/gscdef.c


2013-08-16 14:00:43 +0100
Ken Sharp <ken.sharp@artifex.com>
397abe5622f0a1a9963617fbf1509015563be6fc

Address gp_wgetv not finding *any* environment variables unless compiled with GS_NO_UTF8

The string being passed in as the 'name' was a regular 1 byte C char array.
But _wgetenv expects to be given a wide character string to find and
treats the argument as such. This mean environment variables never matched.

This commit mimics the code for the registry variables, and converts the
name to a wchar before passing to _wgetenv.

CLUSTER_UNTESTED

gs/base/gp_wgetv.c


2013-08-16 12:47:36 +0100
Chris Liddell <chris.liddell@artifex.com>
8b5a86bad386569f921d0322bf113fa82b3d4529

Fix GS_NO_UTF8 build problem with gs_sprintf.

CLUSTER_UNTESTED

gs/base/gp_wgetv.c


2013-08-16 07:58:57 +0100
Ken Sharp <ken.sharp@artifex.com>
182beda4d5199210c4c796c8c501e6e4bb5aa2de

PS Interpreter - yet more meddling with VM allocation and setpagedevice

Bug #694525 "GSView 5.0 does not work with GPL Ghostscript 9.08"

Rather horrifyingly GSView uses undocumented internal operations of
Ghostscript. In this case the changes to VM allocation mode during setpagedevice
were being circumvented.

This commit changes the way we detect a setpagedevice during startup, previously
we check that the dictionary contained one key called /.LockSafetyParams
and if so assumed that this meant we were in startup, so we set the VM
allocation mode to global for the benefit of Display PostScxript.

GSView ended up triggering that test, which caused a VM allocation error.

We now look for the key /.LockSafetyParamsGlobal instead. If this is present
we set the VM allocation mode to global and *replace* the key with
/.LockSafetyParams instead. This allows accurate detection of the startup
condition.

No differences expected, GSView 5 seems to work and the original bug still
is fixed.

gs/Resource/Init/gs_init.ps
gs/Resource/Init/gs_setpd.ps


2013-08-15 12:23:23 +0100
Robin Watts <robin.watts@artifex.com>
dde6d480e632eefbe5ccd42bc52b456582514a2a

Bug 694451: Solve problems with interpolated landscape images.

The portrait image code accumulates pixels into scanlines, and then
plots the whole scanline at once. The landscape image code follows
this lead by accumulating pixels into 'scancolumns' and then plots
the whole column at once.

Unfortunately this accumulation for columns goes wrong in the case
where we are working at < 8 bpp (as the transposition of rows to
columns fails). This causes images with runs of identical pixels in
to be 'squished' vertically.

We work around this here in the < 8 bpp case by repeating the writes
of each pixel so whole bytes are filled. This is suboptimal, but
doing anything else is tricky with the macros the way they are.

gs/base/gxiscale.c


2013-08-14 14:43:00 +0100
Chris Liddell <chris.liddell@artifex.com>
951be31dd84da8f355bfada103ce7e62d5e8c3b2

Update release date for 9.08 release.

gs/base/gscdef.c
gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1


2013-08-09 15:15:53 +0100
Chris Liddell <chris.liddell@artifex.com>
d3d413364f81c379754b7738c58bb7b74b7ed3c4

Delete the ._.DS_Store .DS_Store files.....

which cause problems decompressing release archives on OS X.

gs/lcms2/Projects/mac/.DS_Store
gs/lcms2/Projects/mac/._.DS_Store


2013-08-09 09:10:37 +0100
Chris Liddell <chris.liddell@artifex.com>
e656ce0949b0e8cb8bebc22c820b279b9c2eefa0

Update news and history for 9.08 release.

gs/doc/History9.htm
gs/doc/News.htm


2013-08-08 14:53:48 +0100
Chris Liddell <chris.liddell@artifex.com>
80d7e88123fe9df85cdaeb345c133e3043ddda15

Update version and product strings for release candidate.

gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1
gs/psi/winint.mak


2013-07-31 07:45:02 +0100
Chris Liddell <chris.liddell@artifex.com>
b836761d02ca5829e9ff3f5a64437c3bf29b10db

Change product string for release candidate.

No unexpected cluster differences.

gs/base/gscdef.c


2013-08-20 10:21:09 +0100
Chris Liddell <chris.liddell@artifex.com>
ba1dedf24849295e107df180a291eba99bb33531

Ensure we don't overflow the filename buffer.

No cluster differences.

gs/base/gp_unifs.c


2013-08-20 10:23:02 +0100
Ken Sharp <ken.sharp@artifex.com>
36088d57f45958b3647b21f5ee3908377f113682

Make the Windows implementation of filenameforall match the Unix version

The Unix version of filenameforall starts in the current working directory
when no directory is specified.

When the pattern length exceeds the available string we should return a
rangecheck error, not an empty string.

When the filename exceeds the available string we should return a
rangecheck error, not a truncated string.

CLUSTER_UNTESTED

gs/base/gp_ntfs.c


2013-08-19 15:06:12 +0100
Ken Sharp <ken.sharp@artifex.com>
167ca10abb0a90c4a28a381223afd6fb80347282

Allow use of '\\' for filenameforall and friends on Windows

The commit to allow recursive directory enumeration f13bfba removed the
code which translated '\\' into '\', which could lead to incorrect filenames
being returned.

This fix restores that functionality, but we still think everyone would be
better advised to use the PostScript '/' separator instead, which works as
well as '\' does.

CLUSTER_UNTESTED

gs/base/gp_ntfs.c


2013-08-08 14:53:48 +0100
Chris Liddell <chris.liddell@artifex.com>
80d7e88123fe9df85cdaeb345c133e3043ddda15

Update version and product strings for release candidate.

gs/base/version.mak
gs/doc/API.htm
gs/doc/C-style.htm
gs/doc/Commprod.htm
gs/doc/DLL.htm
gs/doc/Deprecated.htm
gs/doc/Details8.htm
gs/doc/Details9.htm
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Drivers.htm
gs/doc/Fonts.htm
gs/doc/Helpers.htm
gs/doc/History1.htm
gs/doc/History2.htm
gs/doc/History3.htm
gs/doc/History4.htm
gs/doc/History5.htm
gs/doc/History6.htm
gs/doc/History7.htm
gs/doc/History8.htm
gs/doc/History9.htm
gs/doc/Install.htm
gs/doc/Issues.htm
gs/doc/Language.htm
gs/doc/Lib.htm
gs/doc/Make.htm
gs/doc/News.htm
gs/doc/Projects.htm
gs/doc/Ps-style.htm
gs/doc/Ps2epsi.htm
gs/doc/Ps2pdf.htm
gs/doc/Ps2ps2.htm
gs/doc/Psfiles.htm
gs/doc/Readme.htm
gs/doc/Release.htm
gs/doc/Source.htm
gs/doc/Unix-lpr.htm
gs/doc/Use.htm
gs/doc/WhatIsGS.htm
gs/doc/Xfonts.htm
gs/doc/gs-vms.hlp
gs/doc/thirdparty.htm
gs/man/dvipdf.1
gs/man/font2c.1
gs/man/gs.1
gs/man/gslp.1
gs/man/gsnd.1
gs/man/pdf2dsc.1
gs/man/pdf2ps.1
gs/man/pf2afm.1
gs/man/pfbtopfa.1
gs/man/printafm.1
gs/man/ps2ascii.1
gs/man/ps2epsi.1
gs/man/ps2pdf.1
gs/man/ps2pdfwr.1
gs/man/ps2ps.1
gs/man/wftopfa.1
gs/psi/winint.mak


2013-07-31 07:45:02 +0100
Chris Liddell <chris.liddell@artifex.com>
b836761d02ca5829e9ff3f5a64437c3bf29b10db

Change product string for release candidate.

No unexpected cluster differences.

gs/base/gscdef.c


2013-07-31 07:38:05 +0100
Chris Liddell <chris.liddell@artifex.com>
5f71fefc4425c86e682a58c6f692f99978fafdb8

Remove reference to cups/gstopxl from configure.ac

No cluster differences

gs/configure.ac


2013-07-30 17:53:00 +0100
Chris Liddell <chris.liddell@artifex.com>
2db3d0bc1d7bc9e223ac0bcf79c28c234eb906cd

Tidy some MSVC build issues:

Remove spurious explicit "/DDEBUG" directive when linking genarch.exe.

Set debug options for "aux tools" when doing a debug build.

Fix MSVC "clean" target to handle "aux" directory. We weren't deleting all
the files.

CLUSTER_UNTESTED

gs/base/msvccmd.mak
gs/base/msvclib.mak
gs/base/msvctail.mak
gs/base/winlib.mak


2013-07-30 20:40:22 +0200
Till Kamppeter <till.kamppeter@gmail.com>
1c22d3214dff6fedd7b8aaba092dd52eb3b415fd

Merge branch 'master' of ghostscript.com:/home/git/ghostpdl


2013-07-30 11:48:07 -0600
Henry Stiles <henry.stiles@artifex.com>
216b2692178e1113ab7252bf700cd980f5939a89

Fix 694434, fix incorrect parsing of corrupt file.

Invalid PJL was not properly ignored upon parsing.

pl/pjparse.c


2013-07-30 20:29:01 +0200
Till Kamppeter <till.kamppeter@gmail.com>
9304a21699a6c17579fae32f44f5c92a37c13e2d

Moved CUPS filters gstoraster and gstopxl to cups-filters

As Ghostscript's CUPS filters gstoraster and gstopxl need changes to
allow PPD-less printing on IPP printers and these changes introduce
a new dependency on the libcupsfilters library of the cups-filters
project, we have moved these filters to cups-filters now.

In addition, the pdftoraster filter for Poppler-based conversion
of PDF input to CUPS Raster is also not part of Poppler but part
of cups-filters. So we get a more symmetric distribution.

Also maintenance of the filters will get easier this way, especially
duplicate code can move into libcupsfilters.

cups-filters is a free software package hosted by OpenPrinting and it
contains all CUPS filters needed by CUPS under Linux and additional
utilities for CUPS. The filters are not part of the CUPS project at
Apple any more since CUPS 1.6.x.

See
http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters

gs/Makefile.in
gs/configure.ac
gs/cups/colord.c
gs/cups/colord.h
gs/cups/cups.mak
gs/cups/gstopxl.in
gs/cups/gstoraster.c
gs/cups/gstoraster.convs
gs/cups/pxlcolor.ppd
gs/cups/pxlmono.ppd


2013-07-30 10:05:49 +0100
Chris Liddell <chris.liddell@artifex.com>
91d104f9800b8e8e655a5cc1895b626ad57e40e5

Remove debug statement.....

.....left in by mistake.

CLUSTER_UNTESTED

gs/psi/msvc.mak


2013-07-29 23:56:56 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e736e0a6730ee7e047bfd1ad701055eec6dffe85

Fix for Bug 694439. We were not checking the code when we had invalid proc

During the creation of a DeviceN colorspace we were not following up with
an error condition.

gs/psi/zcolor.c


2013-07-29 13:34:17 -0700
Ray Johnston <ray.johnston@artifex.com>
5e303dc64dbe55a5ce42e766e5d6a9753a9d387d

Fix Windows sscanf %p incompatibility with Trio sprintf.

Windows is internally consistent, but writes %p as 8 or 16 hex chars
and it's sscanf expects that format. Trio follows the linux style of
%p which has a leading "0x" followed by the characters. Reading an
address from a string is required for memfile_fopen and memfile_unlink
which are changed to use gs_sscanf which is added to gssprintf.*

gs/base/gssprintf.c
gs/base/gssprintf.h
gs/base/gxclmem.c
gs/base/lib.mak


2013-07-29 13:28:09 -0700
Ray Johnston <ray.johnston@artifex.com>
51309bce92631066e36f117a2e012e05877d6b76

Remove unused local declaration of a dev_spec_op.

gs/devices/gdevplib.c


2013-07-17 14:29:28 +0100
Chris Liddell <chris.liddell@artifex.com>
ebc7505be6340baa73b9c281ef6c593305be3aac

Changes to allow building gs for WinRT/ARM

The contents of the windows-arm-msvc.h file may need modified.

No cluster differences.

gs/arch/windows-arm-msvc.h
gs/base/lib.mak
gs/base/msvccmd.mak
gs/base/msvctail.mak
gs/base/winlib.mak
gs/base/winplat.mak
gs/base/winrtsup.cpp
gs/ghostscript_rt.vcxproj
gs/openjpeg/libopenjpeg/opj_includes.h
gs/psi/gsdllARM32metro.def
gs/psi/msvc.mak


2013-07-25 18:44:48 +0100
Robin Watts <robin.watts@artifex.com>
eddf4893e0e31b1801298eca37d68cd308408283

Push optimisations back into lcms2.

They don't work as well as a plugin factory. I am discussing why this
is the case with Marti.

gs/base/gsicc_lcms2.c
gs/base/lcms2.mak
gs/base/lib.mak
gs/ghostscript.vcproj
gs/lcms2/include/lcms2_extras.h
gs/lcms2/src/cmsxform.c
gs/lcms2/src/extra_xforms.c


2013-07-25 18:30:06 +0100
Robin Watts <robin.watts@artifex.com>
2c2bae08a0a4ec697e95f1732db1246a9fd3401a

Enable our optimisations for lcms2 as a transform factory.

Not all enabled as there seem to be some problems. Talking to
Marti about this now.

gs/base/gsicc_lcms2.c
gs/base/lib.mak
gs/lcms2/src/extra_xform.h
gs/lcms2/src/extra_xforms.c


2013-07-25 11:27:20 +0100
Ken Sharp <ken.sharp@artifex.com>
6ddaa1b971f4d6f96bd57d82484399df82035d9a

pdfwrite - new colour code

We were not using the converted colours for certain spaces, because we were
modifying the 'paint' values, instead of the drawing colour values.

gs/devices/vector/gdevpdfg.c


2013-07-18 15:03:56 +0100
Robin Watts <robin.watts@artifex.com>
b1e63d6e5776c700bf01cb5c1038e8f0b57d29ca

Import LCMS 2.5

Move our optimisations out into an 'extras' plugin, disabled for now.

gs/base/gsicc_lcms2.c
gs/base/lcms2.mak
gs/ghostscript.vcproj
gs/lcms2/AUTHORS
gs/lcms2/ChangeLog
gs/lcms2/Makefile.am
gs/lcms2/Makefile.in
gs/lcms2/NEWS
gs/lcms2/Projects/.gitignore
gs/lcms2/Projects/VC2010/jpegicc/jpegicc.vcxproj
gs/lcms2/Projects/VC2010/lcms2.rc
gs/lcms2/Projects/VC2010/lcms2.sln
gs/lcms2/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcxproj
gs/lcms2/Projects/VC2010/lcms2_static/lcms2_static.vcxproj
gs/lcms2/Projects/VC2010/linkicc/linkicc.vcxproj
gs/lcms2/Projects/VC2010/psicc/psicc.vcxproj
gs/lcms2/Projects/VC2010/testbed/testbed.vcxproj
gs/lcms2/Projects/VC2010/tiffdiff/tiffdiff.vcxproj
gs/lcms2/Projects/VC2010/tifficc/tifficc.vcxproj
gs/lcms2/Projects/VC2010/transicc/transicc.vcxproj
gs/lcms2/aclocal.m4
gs/lcms2/configure
gs/lcms2/configure.ac
gs/lcms2/doc/LittleCMS2.4 API.pdf
gs/lcms2/doc/LittleCMS2.4 Plugin API.pdf
gs/lcms2/doc/LittleCMS2.4 tutorial.pdf
gs/lcms2/doc/LittleCMS2.5 API.pdf
gs/lcms2/doc/LittleCMS2.5 Plugin API.pdf
gs/lcms2/doc/LittleCMS2.5 tutorial.pdf
gs/lcms2/include/Makefile.in
gs/lcms2/include/lcms2.h
gs/lcms2/include/lcms2_extras.h
gs/lcms2/src/Makefile.in
gs/lcms2/src/cmscam02.c
gs/lcms2/src/cmscgats.c
gs/lcms2/src/cmscnvrt.c
gs/lcms2/src/cmserr.c
gs/lcms2/src/cmsgamma.c
gs/lcms2/src/cmsgmt.c
gs/lcms2/src/cmsintrp.c
gs/lcms2/src/cmsio0.c
gs/lcms2/src/cmsio1.c
gs/lcms2/src/cmslut.c
gs/lcms2/src/cmsmd5.c
gs/lcms2/src/cmsmtrx.c
gs/lcms2/src/cmsnamed.c
gs/lcms2/src/cmsopt.c
gs/lcms2/src/cmspack.c
gs/lcms2/src/cmspcs.c
gs/lcms2/src/cmsplugin.c
gs/lcms2/src/cmsps2.c
gs/lcms2/src/cmssamp.c
gs/lcms2/src/cmssm.c
gs/lcms2/src/cmstypes.c
gs/lcms2/src/cmsvirt.c
gs/lcms2/src/cmswtpnt.c
gs/lcms2/src/cmsxform.c
gs/lcms2/src/cmsxform.h
gs/lcms2/src/cmsxform_extras.c
gs/lcms2/src/extra_xform.h
gs/lcms2/src/extra_xforms.c
gs/lcms2/src/lcms2.def
gs/lcms2/src/lcms2_internal.h
gs/lcms2/testbed/Makefile.in
gs/lcms2/testbed/testcms2.c
gs/lcms2/utils/common/vprf.c
gs/lcms2/utils/jpgicc/Makefile.in
gs/lcms2/utils/jpgicc/jpgicc.c
gs/lcms2/utils/linkicc/Makefile.in
gs/lcms2/utils/linkicc/linkicc.c
gs/lcms2/utils/psicc/Makefile.in
gs/lcms2/utils/psicc/psicc.c
gs/lcms2/utils/tificc/Makefile.in
gs/lcms2/utils/tificc/tificc.c
gs/lcms2/utils/transicc/Makefile.in
gs/lcms2/utils/transicc/transicc.c


2013-07-24 13:35:45 +0100
Ken Sharp <ken.sharp@artifex.com>
25a2563e775d849c17885305a4e459a328c2761b

pdfwrite - new colour code, handle 'RGB' same as sRGB for allowed spaces

We were trying to write Shading dictionaries with invalid colour spaces,
this way we degenerate to rectangles which is ugly but works.

gs/devices/vector/gdevpdfg.c


2013-07-23 09:45:02 -0700
Ray Johnston <ray.johnston@artifex.com>
a8384d57fad56058d494616ba196401542a540bc

Fix bug 694423. Segfault in clist image writing at some resolutions.

There was an incorrect check for past the end of the page (obo).

gs/base/gxclimag.c


2013-07-23 14:02:41 +0100
Ken Sharp <ken.sharp@artifex.com>
af38eee8f23f51f74e67cc52d2b72e2dd365bace

pdfwrite - new colour code

Concretize_color doesn't work the way I thought it did. Instead of returning
components in the original base space, it returns components for the current
ProcessColorModel, this has resulted in the removal of several steps.

Modified the code which writes converted base spaces for Separation and
DeviceN spaces, so that the space can be used for images, as well as for
linework.

The code is now no longer crashes when the ColorConversionStrategy is
CMYK.

There are still some oddities with CIE/RGB to CMYK conversion, there are
some problems with CMYK output with type 4 images. Still need to test
Gray and RGB strategies, and redo LeaveColorUnchanged and UseDeviceIndependentCOlor
with the latest changes.

gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfg.h
gs/devices/vector/gdevpdfi.c


2013-07-22 16:38:22 +0100
Ken Sharp <ken.sharp@artifex.com>
c0d9447b67dcef12d9d321a128985ee77e46fabd

pdfwrite - new colour conversion code, fix Indexed Separation/DeviceN

The previous code for converting the base space of a Separation or DeviceN
space didn't cater for the possibility of a /Indexed space. This code now
does.

In addition we do a better job of identifying when a base space needs
converted, there was similar problem here leading to us converting (eg)
CMYK to CMYK.

There are some oddities with RGB->CMYK conversion that I need to discuss
with Michael.

gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfg.h


2013-07-19 13:22:55 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
9b1a5d0dce3a375ccd4be010d50b3d91929bb982

Fixed a couple of errors in previous commit.

gs/base/gscie.c
gs/base/gxhintn.c


2013-07-19 13:10:48 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
37aca23d758c3b5cb53da10aaeccd623f625e01a

Remove C++ style comments.

These cause issues with some versions of the AIX C compiler.

gs/base/gscdevn.c
gs/base/gscie.c
gs/base/gxhintn.c
gs/base/sjbig2.c
gs/base/sjpx_openjpeg.c


2013-07-18 09:10:54 -0400
James Cloos <cloos@jhcloos.com>
7f764e594f2f23bac77748693d1c8e886af5b103

Remove MaxBufferedTotal, MaxBufferedArea and MaxBufferedCount

If MaxBitmap is set but MaxBufferedTotal and/or MaxBufferedArea are too small
some documents will fail to display.

X servers and client boxen have much more ram than they did 10–20 years ago;
limiting the size of client-side caches beyond what MaxBitmap supports has
little remaining value.

So deprecate and remove those limits.

Signed-off-by: Henry Stiles henry.stiles@artifex.com

gs/devices/gdevx.c
gs/devices/gdevx.h
gs/devices/gdevxini.c
gs/doc/Use.htm


2013-07-17 21:43:23 +0100
Chris Liddell <chris.liddell@artifex.com>
11dca09b381cac3a85625d7a408ccdf7458b1f9e

Bug 694421: use correct .notdef in CIDType 2 fonts

When cmap table is too short for the CID we're looking for, use the CharStrings
dictionary to get the GID of the .notdef glyph instead of throwing an error.

No cluster differences.

gs/psi/zfapi.c


2013-07-15 23:17:44 +0000
Hin-Tak Leung <hintak@ghostscript.com>
94196ed84e5b8d264522b378972472ad4b54ed90

Silent a "Value not read" compiler warning.

It is true that the value is no longer used after this point,
therefore no need to update further. Though it might be
confusing if its value for its intended meaning is used
again in the future, say, to detect broken input files.
Comment it out for now.

pxl/pxvendor.c


2013-07-15 14:37:10 -0600
Henry Stiles <henry.stiles@artifex.com>
777307f9e2aa4c2d74e96dd9c3f1630677c680a6

Fix 694416, the default DCT color transform was not set up correctly.

The fix was derived directly from MuPDF and is consistent with the
documentation.

gs/base/sdctd.c


2013-07-13 12:27:55 +0100
Chris Liddell <chris.liddell@artifex.com>
9834a3b011070a5565b5dcc536f6c2eace10569c

Changes to allow mingw DLL build

Building the mingw DLL still uses the "so" target.

Also, tidy up and rationalise the way the "so" target works on OS X. It no
longer relies on a special subtarget.

No cluster differences.

gs/Makefile.in
gs/base/unix-dll.mak
gs/base/unixhead.mak
gs/configure.ac


2013-07-14 23:30:50 +0000
Hin-Tak Leung <hintak@ghostscript.com>
37b9962406c99564f6ac16e37540a45cfae5d557

Bug 693661 - implement HP CLJ 3500/3550/3600 emulation

The actual subject of the bug report is
"pcl6 interpreter exited with error code -995".

This patch adds two new files, pxl/pxvendor.{c,h} which implement
HP CLJ 3500/3550/3600 emulation, plus small associated changes
in existing files.

Included and somewhat less related are:

- a small change of pl/plmain.c to not repeat repeated error messages,
- switching some 12-year-old debug code from '|' (experimental)
to '|' (interpreter), to make genuine exp code devel easier.
- a minor bug fix to px_attribute_names in
pxl/pxptable.c reported elsewhere which affects debug messages,
- some stubs in pxl/pxsessio.c and tools/pxldis.py
for HP 1011/1012/1015 emulation.

Where/what those are should be fairly obvious.

No cluster differences.

gs/base/gdevpxat.h
gs/base/gdevpxen.h
pl/plmain.c
pxl/pxl.mak
pxl/pxptable.c
pxl/pxsessio.c
pxl/pxstate.h
pxl/pxvendor.c
pxl/pxvendor.h
tools/pxldis.py


2013-07-12 12:56:50 +0100
Ken Sharp <ken.sharp@artifex.com>
f3fdc7a37f529f0562a4290d3fce4cced2cd4820

PDF interpreter - set colour nad space at the time the relevant operators execute

In the past we have only set the colour space and colour values for stroke
and fill when we actually perform a stroke or fill operation. At the time
the space and colour was set we would simply store the data.

This can cause problems with a sequence like this:

/CS0 cs 0.2 0.1 0 0 scn
q
....
f
Q

q
....
f
Q

Each time we set the colour and space we then restore back to a point
before that space was set. On the next fill we need to set the space again.
If the colour space is an expensive one to set (eg ICCBased) then we waste
a lot of time.

The 'simple' solution is to set the colour space at the time it is set in
the PDF file. However, this also meant setting the colour values at the
time they are set (or we could get space and colour unsynchronised). This
further led to the discovery that the transparency code can set colours in
a different space to the saved space (eg for an SMask). So it was necessary
to have an additional set of routines, one which simply stores the state
and one which stores and sets it to be the current space/colour.

The time taken for the specimen file is reduced from approximately 4.5
minutes to around 3.5 seconds. In addition the file CATX1101.pdf shows a
progression with pdfwrite (gray drop shadow was missing). Because pdfwrite
no longer swaps colour spaces so frequently with text, text is more often
emitted as a single operation, which leads to smaller files (15% smaller
in one case) but does show some very minor (1 pixel) positioning changes
in text.

gs/Resource/Init/pdf_draw.ps
gs/Resource/Init/pdf_ops.ps


2013-06-11 22:49:05 +0200
zeniko <zeniko@gmail.com>
c15166f8be1e1081e5b2beecf46b25f1cbd14d5f

Bug 694125: prevent heap underflow

jbig2_decode_mmr_line checks the arguments to jbig2_set_bits since the
fixes to issue 693050, however these checks still allow for the starting
index to be negative which results in a write underflow; fixes
2860.pdf.asan.9.2069

gs/jbig2dec/jbig2_mmr.c


2013-07-11 08:39:34 +0100
Chris Liddell <chris.liddell@artifex.com>
076ffc56da93051fb14930394b2026e1821f3cb7

Bugs 693828: pull in new URW+ GPL fonts.

Also 693827, 688557, 691909, 690896 and 687297.

Many differences: most files that use the standard font set change. Changes of
note are that in Nimbus L Sans Italic several of the "symbol" glyphs (like
/plus, /plusminus etc) used to be italicised and are now not. This actually
matches the Adobe equivalent font.

Also there are some cases of the /M glyph being narrower than previously, again
this is correct wrt to the Adobe equivalent.

gs/Resource/Font/CenturySchL-Bold
gs/Resource/Font/CenturySchL-BoldItal
gs/Resource/Font/CenturySchL-Ital
gs/Resource/Font/CenturySchL-Roma
gs/Resource/Font/Dingbats
gs/Resource/Font/NimbusMonL-Bold
gs/Resource/Font/NimbusMonL-BoldObli
gs/Resource/Font/NimbusMonL-Regu
gs/Resource/Font/NimbusMonL-ReguObli
gs/Resource/Font/NimbusRomNo9L-Medi
gs/Resource/Font/NimbusRomNo9L-MediItal
gs/Resource/Font/NimbusRomNo9L-Regu
gs/Resource/Font/NimbusRomNo9L-ReguItal
gs/Resource/Font/NimbusSanL-Bold
gs/Resource/Font/NimbusSanL-BoldCond
gs/Resource/Font/NimbusSanL-BoldCondItal
gs/Resource/Font/NimbusSanL-BoldItal
gs/Resource/Font/NimbusSanL-Regu
gs/Resource/Font/NimbusSanL-ReguCond
gs/Resource/Font/NimbusSanL-ReguCondItal
gs/Resource/Font/NimbusSanL-ReguItal
gs/Resource/Font/StandardSymL
gs/Resource/Font/URWBookmanL-DemiBold
gs/Resource/Font/URWBookmanL-DemiBoldItal
gs/Resource/Font/URWBookmanL-Ligh
gs/Resource/Font/URWBookmanL-LighItal
gs/Resource/Font/URWChanceryL-MediItal
gs/Resource/Font/URWGothicL-Book
gs/Resource/Font/URWGothicL-BookObli
gs/Resource/Font/URWGothicL-Demi
gs/Resource/Font/URWGothicL-DemiObli
gs/Resource/Font/URWPalladioL-Bold
gs/Resource/Font/URWPalladioL-BoldItal
gs/Resource/Font/URWPalladioL-Ital
gs/Resource/Font/URWPalladioL-Roma


2013-07-11 08:33:35 +0100
Chris Liddell <chris.liddell@artifex.com>
283427799129175b4b6338e718aca0c26d917a54

Make W/W* "context" survive text operations.

If we have a text operation between a W/W* operator and the path operation that
ends the W/W* context, we end up entering an infinite loop because the W/W*
context prevents us from writing the changes to the graphics state required
to render the text.

To handle this, we now end the W/W* context, and store the dictionary
temporarily while we complete the text operation, then restore W/W* context
after.

It is not clear how this is supposed to interact with the clipping text
rendering modes, but on the basis of solving an infinite loop, I'm committing
this, and will address issues if they arise.

No cluster differences.

gs/Resource/Init/pdf_ops.ps


2013-07-09 10:58:01 +0100
Ken Sharp <ken.sharp@artifex.com>
0903afb23777cfee2cb2a5015990c174e6a54742

pdfwrite - Fix image writing code when converting colour spaces (old CMS code)

Bug #694401 "pdfwrite produces incorrect pdf file"

The command line for this bug specifies -dPDFSETTINGS=/ebook. This sets a
number of parameters, specifically it sets ColorConversionStrategy to sRGB.
The input file contains an image in DeviceGray with 1 bit per component,
the specified colour conversion strategy means we convert this to RGB.

The original image was drawn with a resolution of 200 dpi, which does not
trigger monochrome downsampling in this setup (300 dpi). However when
converted into a colour image it does trigger downsampling as the threshold
for colour images is 72 dpi in this configuration.

The combination of colour conversion and image downsampling seriously
confused the horrific code in pdfwrite, and led to use writing out the wrong
amount of data for the image as well as corrupting the image data as it
passed through the filters.

This patch sorts this out by setting various parameters, and copying/restoring
them as required to initialise the various filters correctly.

For some reason this shows a difference with test file Bug691425.pdf but the
visual appeaance is the same.

gs/devices/vector/gdevpdfi.c


2013-07-09 07:54:37 +0100
Ken Sharp <ken.sharp@artifex.com>
a9f3d46240cda455d8f42feee2350f40fa26e3e7

Fix a benign compiler warning

Check a return code and take appropriate action, this was a pre-existing
fault flagged up when the code changed with the prior commit.

gs/devices/vector/gdevpdtt.c


2013-07-08 08:09:12 -0600
Henry Stiles <henry.stiles@artifex.com>
8accdfa6986e7247103e80b7c12dd6b39ddf8a4c

Remove code supporting obsolete color spaces.

pcl/pccid.c


2013-07-06 21:05:06 -0600
Henry Stiles <henry.stiles@artifex.com>
392041413cb1d11dff0af986b41f871c19287f56

Remove Java based PCL viewer and its supporting code.

pcl/pcpage.c
pl/pjparse.c
pl/plmain.c
pl/plmain.h
tools/viewer/Gpickle.java
tools/viewer/GpickleObserver.java
tools/viewer/GpickleThread.java
tools/viewer/Gview.java
tools/viewer/JavaDoc/allclasses-frame.html
tools/viewer/JavaDoc/deprecated-list.html
tools/viewer/JavaDoc/gpickle.html
tools/viewer/JavaDoc/gpickleobserver.html
tools/viewer/JavaDoc/gpicklethread.html
tools/viewer/JavaDoc/gview.html
tools/viewer/JavaDoc/help-doc.html
tools/viewer/JavaDoc/index-all.html
tools/viewer/JavaDoc/index.html
tools/viewer/JavaDoc/nav.html
tools/viewer/JavaDoc/overview-tree.html
tools/viewer/JavaDoc/package-frame.html
tools/viewer/JavaDoc/package-list
tools/viewer/JavaDoc/package-summary.html
tools/viewer/JavaDoc/package-tree.html
tools/viewer/JavaDoc/packages.html
tools/viewer/JavaDoc/serialized-form.html
tools/viewer/JavaDoc/stylesheet.css
tools/viewer/Nav.java
tools/viewer/README


2013-07-06 21:04:35 -0600
Henry Stiles <henry.stiles@artifex.com>
2035b67856e69b75c5466d44fd287f1d0cd721b3

Debug statement to indicate implicit raster exit.

pcl/rtgmode.c


2013-07-05 09:07:05 +0100
Ken Sharp <ken.sharp@artifex.com>
34e2ae40bff4d288da83dcd739e50287bf7c3c2e

pdfwrite - implement idioms for PScript 5 artificial bld text

Bug #688007 "cjk bold fonts printed many times"

The artifical emboldening of fonts in the pscript 5 DLL works by drawing
the same text 4 times in slightly different positions. THis causes
pdfwrite to emit 4 sets of text.

Here we implement idiomns for the range of 'show' operations valid in
Pscript5, and if the device supports text rendering modes we draw the text
only once in text rednering mode 2 (fill and then stroke). The Pscript5
code uses 'sBdx' to determine the offset of the text, but this is actually
a constant derived by dividing the target print resolution by 300. We use
a fixed figure derived heuristically instead.

During the work it became apparent that the existing code in pdfwrite to
handle stroked text didn't work properly as it could emit stroke
parameters during the course of a text object, which Acrobat ignores. SO
the code has been altered to exit the text object whenever text is
stroked. This is inefficient as we might not need to emit any stroke
parameters, but it solves the problem, and text rendering modes are not
widely used.

This shows a small progression in pdf-t3-simple.pdf and some small
differences in other files.

gs/Resource/IdiomSet/Pscript5Idiom
gs/devices/vector/gdevpdtt.c


2013-07-05 16:16:27 -0600
Henry Stiles <henry.stiles@artifex.com>
27332dab4d0b6ec7bab5cafef86a693c5d600dd7

Partially address 694378 - mispositiosed graphics.

Implement the GL Frame Advance (FR) technical extension with a simple
page feed.

pcl/pgconfig.c
pcl/pgmand.h


2013-07-02 13:03:51 +0100
Chris Liddell <chris.liddell@artifex.com>
a8d0fa19f927d045b81ec0380ea7448de38176d9

Disable OpenJPEG SSE on Windows again.

Shelly reports that enabling SSE in Windows causes crashes in most of the
JPX test jobs. At least for the present, disable it.

CLUSTER_UNTESTED

gs/psi/msvc.mak


2013-07-03 09:50:54 +0100
Ken Sharp <ken.sharp@artifex.com>
3123e3ad0299dbc1cefc77f342e5f23e7be28a71

Fix a minor compiler warning in the previous commit

gs/devices/vector/gdevpdfd.c


2013-07-03 09:05:16 +0100
Ken Sharp <ken.sharp@artifex.com>
489253b834075391d7826bc81ef52ede34f8289f

pdfwrite - better identify rectangular clips, and emit as rectangles

Bug #687931 "GS produces large PDF files"

The file uses *many* rectangular clips to draw through, previously pdfwrite
mostly emitted these as a sequence of lines, because only a small class of
clip paths could be identified as rectangular.

This commit levers the existing gx_path_is_rectangle to identify many more
rectangular clip paths, and emit them using the 're' operator instead, which
is more compact on output.

The specimen file now produces 30% smaller PDF files.

This does introduce some differences, in the main these are very small single
pixel or one pixel wide lines. In the case of the Quality Logic test suite, the
'frame' for the tests is drawn through a clip, and one edge is now slightly
wider, since it better matches the width of the other edges this is a
progression. It affects a large number of QL tests.

gs/base/gxcpath.c
gs/base/gxpath.h
gs/devices/vector/gdevpdfd.c


2013-07-02 10:31:48 +0100
Ken Sharp <ken.sharp@artifex.com>
939e32ff3c8841507aed80435269457f3caac6f5

More work on setpagedevice and global allocation mode

The commit 073f7be1671e7fa2dbbc75984e593d2279bb05d7 solved one problem,
but introduced another. Specifically Ghostscript feiled to start when
-dSAFER was specified.

The reasons are convoluted, the background is as follows:

Adobe interpreters appear to always return a local VM writeable dictionary
from currentpagedevice (despite that fact that the spec clearly says its
read-only). WordPerfect files have, in the past at least, relied upon this
and tried to write to the dictionary.

To solve this, our currentpagedevice copies child dictionaries to dictionaries
allocated in local VM (and writeable). This fails if we attempt to do a
setpagedevice while the VM allocation mode is local, because the parent
dictionary is in global VM, and we then attempt to put locally allocated
children in it.

The earlier commit resolved this by forcing the VM allocation mode to local
during the course of setpagedevice, which meant that the dictionary returned
by currentpagedevice was allocated in local VM, so it was safe to put the
child dictionaries in it.

But, if we run with -dSAFER, the in gs_init.ps we do an early call to
setpagedevice in order to set /.LockSafetyParams. We do this while the VM
allocation mode is global. Note that setpagedevice stores a pointer to the
returned dictionary in the graphics state. Now, when we run the Display
PostScript startup code, it insists that all objects in the 'savedinitialgstate'
must be in global VM. But we've saved the current page deice there, and it
was allocated in local VM, which leads to an error.

So in order to satisfy the WP bug, we need to have the children allocated in
local VM. In order to call setpagedevice when the allocation mode is global
we need to create the page device dict in local VM. In order to satisfy the
DPS code, we need to allocate the page device dict in global VM.

Oops.

This commit attempts to work around this by setting the VM allocation mode
to local for the course of setpagedevice, but *not* when we are executing
the code for -dSAFER.

This is a hacky solution, and I suspect prone to failure, but probably only
if we change the startup code, which we rarely do.

No diffrences expected

gs/Resource/Init/gs_setpd.ps


2013-06-29 15:53:58 +0100
Ken Sharp <ken.sharp@artifex.com>
06d63d8edfd5d8eac76b96ea2e66f5cf165b6997

Fix a typo in txtwrite, this may be related to bug #694389

gs/devices/vector/gdevtxtw.c


2013-06-29 09:38:53 +0100
Ken Sharp <ken.sharp@artifex.com>
f560b73066ee787678a31973bca411bedc6ca0f6

fix a minor compiler warning

gs/psi/zdevice.c


2013-06-28 09:18:49 +0100
Ken Sharp <ken.sharp@artifex.com>
13105ccf9c02d29058ab0ff3f9bdb48387ec7b6e

Invalidate device refs on the operand stack when we change device

Bug #690925 "SEGV after "gsave nulldevice currentdevice grestore setdevice"

currentdevice stores a reference containing a pointer to the current device
structure on the operand stack. If we close the device, then attempt to do
'setdevice' using the stored pointer from the operand stack we can get a
seg fault if we have restored away the device, because the device structure
memory has been released.

Altered nulldevice and setdevice so that when we change devices we scour
the operand stack looking for saved references to devices. If we find any
we NULL the pointer to the device. This allows us to check for a NULL device
pointer in setdevice and raise an error instead of crashing.

No differences expected.

gs/psi/zdevice.c


2013-06-27 14:58:13 -0600
Henry Stiles <henry.stiles@artifex.com>
d5d3b85af33c679927e908154482fab576922fc0

Fix bug #694355, incorrect rendering of raster image.

This problem is very similar to bug #693111, and I don't think we have
a clear handle on how the interpreter should behave when locked out
commands are received in raster mode (with RTL). For this problem we
don't shut down graphics when receiving the render algorithm command,
the other bug involved a transparency command. A new bug will be
opened to review both of these bugs. Although, both fixes are
effective and safe, I'm afraid they don't address the underlying
issue.

pcl/pcpalet.c


2013-06-27 14:51:50 -0600
Henry Stiles <henry.stiles@artifex.com>
7b7cb6d314aab998d8b40e1ff782149aebbf06a2

Reassign devices owned by Alex.

doc/who_owns_what.txt


2013-06-27 15:41:49 +0100
Ken Sharp <ken.sharp@artifex.com>
1fc07e783d8758e4bfdc8b8ebe68a875b30568ae

commit 9034712 used abs, which oddly caused many timeouts. Multiplying by
-1 instead seems to solve this.....

gs/base/gsptype1.c


2013-06-27 15:39:19 +0100
Ken Sharp <ken.sharp@artifex.com>
9034712f22eff916280f4555d88237da99bcaeda

When clamping pattern BBox to page, make sure to scan in proper direction

Bug #694385 "endless loop in pattern"

The code for clamping the pattern BBox to the page starts left and below the
page, and then scans across and up detecting if any part of the pattern is
on the page.

Unfortunately, this didn't account for negative xstep and ystep. Because
we are only scanning the area, the easiest solution is just to abs() the
values, so that we are sure to scan left-right and bottom-top.

No differences expected.

gs/base/gsptype1.c


2013-06-08 09:12:30 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c27113ab96a8010b59652bde975eec68865aebb5

Change in behavior for overprint. Fixes bugs 694295 694296 and 694067

With this change we now do simulated overprinting of cmyk AND spot colorants
for contone cmyk devices by default. If -dSimulateOverprint=false is specified we
will not simulate overprinting of any colors.

Also, cmyk simulation of spot colors with separation devices is not handled.
i.e. if you specify -dSimulateOverprint=true -dMaxSpots=0 -sDEVICE=tiffsep1
you will see the spot colors blended in CMYK space if overprint has been
specified in the document.

Note that not all overprint situations can be simulated accurately with this
approach. For example, if I have a spot color that resulted in a CMYK value
of 0 0 100 0 after the alternate tint transform and then I did an overprint with
a CMYK value of 0 0 1 0, the color should still be a bright yellow but will actually
be almost no color. The issue is that we can not distinguish this case from one
where we had first laid down a CMYK of 0 0 100 0 followed by the overprint of 0 0 1 0
which should be a light yellow. The documentation has been updated to point this out.

I reviewed all the diffs that came up in the bmpcmp and reviewed the Ghent overprint
files.

gs/base/gscdevn.c
gs/base/gscsepr.c
gs/base/gsdparam.c
gs/base/gsicc.c
gs/base/gsicc_manage.c
gs/base/gsovrc.c
gs/base/gsstate.c
gs/base/lib.mak
gs/doc/Use.htm


2013-06-26 17:16:35 +0100
Ken Sharp <ken.sharp@artifex.com>
073f7be1671e7fa2dbbc75984e593d2279bb05d7

Ensure all objects created for use during setpagdevice are in local VM

Bug #687702 "gs8.15 setpagedevice /invalidaccess"

The problem is caused by currentpagdevice returning a dictionary allocated
in the current (global) VM. We later create an OutputAttributes dictionary
which is in local VM, and store it in the dictionary returned. This fails
of course.

Since these objects are only used internally to construct various intermediate
structures during the course of a setpagedevice, the easiest solution to this
is to force the VM allocation mode to local for the duration of setpagedevice.

No differences expected.

gs/Resource/Init/gs_setpd.ps


2013-06-26 13:18:43 +0100
Chris Liddell <chris.liddell@artifex.com>
bcc1052afdec7b4da66c832c97bcba990a1863e0

Bug #686853 "filenameforall enumerates incompatible with Adobe"

Fix the Unix/Linux file enumeration code to correctly recurse into
directories.

This causes differences in many of the Quality Logic Postscript LL3 test suite
tests because it can now overflow the size of the "scratch" string used in the
tests and that results (correctly) in a rangecheck error from filenameforall.

Obviously, that depends on from where in the directory hierarchy the executable
is being run, and the contents of the directory structure below that.

gs/base/gp_unifs.c


2013-06-24 15:20:03 +0100
Ken Sharp <ken.sharp@artifex.com>
f13bfba957c536630a241351df49c5007a0664d9

rework the NTFS file enumeration to rescurse into sub-directories

Bug #686853 "filenameforall enumerates incompatible with Adobe"

Existing code did not recurse into sub-directories whereas Adobe interpreters
do (but they do not list sub-directory names, just their contents).

In addition the Linux and Windows code has long been incompatible, because
the Linux code *does* list the sub-directory names, even though it doesn't
recurse into them.

With this patch the NTFS file system code now recurses and lists the
sub-directory contents in the same fashion as Adobe.

The Linux file system code needs work. After discussion with Chris we have
decided not to proceed with the same work on VMS, OS/2 or DOS, as we don't
even have systems to test the code compilation, let alone its execution.

All these Operating Systems are obselete, and nobody ahs complained about
the existing code in many years, so we don't expect to offer a bounty
for adding this. However, if anyone has access to an appropriate system and
wants to offer us a patch, we will probably adopt it.

No differences expected, the cluster doesn't run NTFS.

gs/base/gp_ntfs.c


2013-06-26 13:17:41 +0100
Ken Sharp <ken.sharp@artifex.com>
16733f6f179bcb98c371915a738b01a4e1f26ac2

Add some Encodings listed in the PLRM

Bug #688710 "Fix the Encoding resource category"

As noted int he bug thread I so not consider it worthwhile to tackle some
of the propsed work described there. However the CE Encoding is missing,
as are also the ExpertEncoding and ExpertSubsetEncoding resources.

This commit adds all three resources and the NotDefEncoding which is present
in Adobe Acrobat Distiller. We also revisit the patch (gs-cvs rev
6834) originally committed against this bug, which prevented the Subversion
source control directory being enumerated as an Encoding resource. Since we
no longer use Subversion, and the current system doesn't rely on hidden
sub-directories, this is no longer required.

No differences expected

gs/Resource/Encoding/CEEncoding
gs/Resource/Encoding/ExpertEncoding
gs/Resource/Encoding/ExpertSubsetEncoding
gs/Resource/Encoding/NotDefEncoding
gs/Resource/Init/gs_fntem.ps


2013-06-25 09:05:10 +0100
Hin-Tak Leung <hintak@ghostscript.com>
341dfa13b8ad4afadf8b2a8a7302422755911b36

Bug 690692: more robust check for TTF/OTF files

No cluster differences.

gs/Resource/Init/gs_ttf.ps


2013-06-25 08:55:08 +0100
Chris Liddell <chris.liddell@artifex.com>
200dc18647ae24995e28607f838d77affbfc7638

Set colors up correctly when rendering Type 3 glyph

In the 'd1' operator, if the glyph metrics are clearly wrong, we fall back to
rendering the glyph uncached. The original code failed to do the required
color setup in this path through the code.

The simplest solution, rather than repeat the same code, is to call the 'd0'
operator, after appropriate stack manipulations.

Noticed in passing working on an issue from customer 532.

No cluster differences.

gs/Resource/Init/pdf_font.ps


2013-06-20 13:24:01 -0700
Ray Johnston <ray.johnston@artifex.com>
10f6e526ec702fd8b74405d3e7461b428bdbdf31

Fix wrong GrayDetection when images have MultipleDataSources true - cust 801.

Since we already had a buffer, we unpack the samples from the planes into the
buffer using 'spread' to space them so they form a chunky pixel buffer for
row_has_color. Refactor the unpacking into the buffer out of row_has_color to
the caller where we have the planes array. Note that the buffer returned from
the 'unpack' proc may be the original data source so we save that for calling
row_has_color.

gs/base/gxclimag.c


2013-06-21 07:43:15 +0100
Chris Liddell <chris.liddell@artifex.com>
8ff1b883db9e7d2cd8c940a5ea7f0e4bad78903d

Move winrt platform build into "base".

One file required for the winrt platform was being built in psi/msvc.mak, this
moves it to winlib.mak with the rest of the platform.

CLUSTER_UNTESTED

gs/base/winlib.mak
gs/psi/msvc.mak


2013-06-19 19:10:21 +0100
Chris Liddell <chris.liddell@artifex.com>
b405fdcb395f2b48226af7a55a714d4dd3d50a75

Define GS_NO_UTF8 for mingw

Noticed in passing, GS_NO_UTF8 is needed for mingw.

No cluster differences.

gs/configure.ac


2013-06-19 18:14:13 +0100
Chris Liddell <chris.liddell@artifex.com>
14a88dcf3fb49d1fd31b0a6500e22c7d066a1185

Enable SSE2 code in openJPEG on Windows.

CLUSTER_UNTESTED

gs/psi/msvc.mak


2013-06-19 17:04:31 +0100
Chris Liddell <chris.liddell@artifex.com>
10de1e0bf9f3abd9c74401258388067c6e2ec36f

valgrind: fix invalid read error in png devices

Noticed passing, several of the png devices left the downscale factor and
min feature size entries in the device uninitialized.

No cluster differences.

gs/devices/gdevpng.c


2013-06-19 16:25:17 +0100
Chris Liddell <chris.liddell@artifex.com>
f1b0e276370fd632ac7e18c39cffe9972fe67444

Bug 693934: CCITT Fax decode - cope with negative run length

In various places in the fax decode code we coped with the run length being
negative - in just a few we didn't.

We'll now cope gracefully with negative run lengths in places.

No cluster differences.

gs/base/scfd.c


2013-06-19 16:29:42 +0200
Till Kamppeter <till.kamppeter@gmail.com>
b871884a283bbe8d908f47844ffff4cf6f009803

White-space clean-up in gstoraster

gs/cups/gstoraster.c


2013-06-19 15:26:12 +0200
Till Kamppeter <till.kamppeter@gmail.com>
1149c245e70fcf6b0445f0958a7c1bb972b26f63

Fixed also the suppression of color management via colord in gstoraster

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712045.

gs/cups/gstoraster.c


2013-06-19 14:52:25 +0200
Till Kamppeter <till.kamppeter@gmail.com>
1b87b820854525f9709f19f3bb932e4f75210637

Make colord-supplied ICC profile getting applied by gstoraster

Patches from Debian bug #712045:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712045

Thanks to Alexey Galakhov for the bug report and the patches.

gs/cups/gstoraster.c


2013-06-19 11:32:19 +0100
Ken Sharp <ken.sharp@artifex.com>
daceba62fcce274fc62e750ac186b3a9026554ad

PDF interpreter - ignore invalid /DecodeParams for streams

Bug #694353 "**** File has unbalanced q/Q operators (too many Q's) **** endless loop"

The PDF file is invalid, it has a /Filters array with 2 elements, and a
/DecodeParams array with 1 element. The DecodeParams array must have either
the same number of elements as the Filters, or not be present (default).

We now test the length of each array and ignore the DecodeParams if the lengths
are not the same (as we have no way to know which Params relate to which Filter)

No differences expected

gs/Resource/Init/pdf_base.ps


2013-06-19 08:53:01 +0100
Chris Liddell <chris.liddell@artifex.com>
1c9ac1bc3caaad5d2ea9e277d1b89a5c56b31c5c

Bug 694357: allow override of gcc's __SSE__ define

OpenJPEG uses gcc's "built-in" preprocessor define of __SSE__ to determine
whether to use its SSE2 code. As we have a configure option to disable SSE2
use in Ghostscript, that option now also overrides the gcc define thus
disabling SSE2 in OpenJPEG, too.

This currently only works for gcc.

No cluster differences.

gs/configure.ac


2013-06-18 16:50:17 +0100
Chris Liddell <chris.liddell@artifex.com>
fea396d5d3202bf3c6b1207b5c8a17b979d0bb4f

Bug 694318: remove reference to freed resource

When we're about to free a PDF resource object in pdfwrite, make sure we remove
references to it in the substream stack.

No cluster differences

gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfu.c


2013-06-18 12:02:01 +0100
Ken Sharp <ken.sharp@artifex.com>
95cd6ab8bf3a8866a5a10571a0c034869a4ba064

PDF interpreter - handle empty cref by rebuilding it.

Bug #694342 "Error: /typecheck in --run-- reading PDF file"

The PDF interpreter didn't notice that an empty xref (the xref token
immediately followed by the trailer token) was not a valid xref. Later we
would attempt to use the empty xref, and fail.

We now check the length of 'Objects' when we find the trailer token and if
it is 0 we throw an error. This causes the PDF itnerpreter to rebuild the
xref table by rescanning the whole file.

gs/Resource/Init/pdf_main.ps


2013-06-18 08:20:04 +0100
Chris Liddell <chris.liddell@artifex.com>
bd2887990301b12c2b11df323ee726855129a637

Bug 694354: cope being unable to read a candidate font file

On Unix, things like directories can be opened as "files". In the font code,
we attempt to open a candidate font file, and if that fails, handle it. We
then read some data from the file to validate it as a suitable font file. If
the data we read reveals it to be an unsuitable file, we handle that.

We were not handling the case where we could open the "file" but could not
read from it.

No cluster differences.

gs/Resource/Init/gs_fonts.ps


2013-06-17 15:46:52 +0100
Chris Liddell <chris.liddell@artifex.com>
bd08091d295effb51de2cc7e739870e7b2628e38

Bug 694319: "finalize" a font stream before return an error.

pdfwrite and pswrite could, in the event of an error during font writing, leave
the "stream" for the font in a) an invalid state, and b) in place for the
continued writing of the output file.

This caused memory corruption, seg fault etc.

No cluster differences.

gs/devices/vector/gdevpdtb.c


2013-06-17 13:01:43 +0200
Till Kamppeter <till.kamppeter@gmail.com>
489811e366495db7374f2cf3c71bd4a9bdf77360

Prevent gstoraster from hanging on Ghostscript failure

Thanks to Olivier Blin for this patch.

Original discription in the bug report (bug 693336):

When gs fails and the input file is bigger than the pipe capicity
(65536 bytes on Linux), gstoraster will hang. In this case, write()
will block because the pipe is full and no reader is emptying it. The
gs child process becomes a zombie, and write() will not fail until its
zombie is gone, which never happens with the current code.

This patch fixes the issue by adding a child reaper, which will make
write() fail when the child dies, either because of the SIGCHLD signal
coming, or because of a broken pipe error in write().

gs/cups/gstoraster.c


2013-06-17 08:52:37 +0100
Chris Liddell <chris.liddell@artifex.com>
579e9024d1bc358fe12bcceb00e1ba1797e473ec

Bug 694319 (related): bounds checking T1 op stack

Add some lower bounds checking for the operand stack, to one of the Type 1
charstring interpreters used by pdf/ps2write.

This fixes one of the memory corruption problems with Bug693711.pdf.

No cluster differences.

gs/base/gxtype1.c


2013-06-15 10:00:35 +0100
Ken Sharp <ken.sharp@artifex.com>
0c9e630460084182f0347570b38aa606a5a8a2e8

pdfwrite - silence a Valgrind warning by initialising a variable

The memory is uninitialised because the file provokes an error, and
pdfwrite gets confused about which file it is supposed to be in, The net
result is that an MD5 hash is not generated and we end up with some memory
not being initialised.

This simply sets the memory to 0 which silences Valgrind, it makes no
attempt to improve the output.

No differences expected.

gs/devices/vector/gdevpdfe.c


2013-06-14 09:59:55 -0700
Ray Johnston <ray.johnston@artifex.com>
65744368052b127b596014d55a6ea776808a6640

Fix gs_pdf14_device_color_mon_set and remove compiler warnings.

The previous function only set the value to false, and this should
set the value to the bool 'monitoring' that is the second arg.

gs/base/gdevp14.c
gs/base/gsicc_monitorcm.c


2013-06-14 11:04:31 +0100
Chris Liddell <chris.liddell@artifex.com>
cb2e0f784882696e930e5077ecb1a2feef76fadf

Fix pointer confusion in gs_private_st_ptrs2_final()

The order of the pointer arguments in one of the "sub-macros" used in the
definition of gs_private_st_ptrs2_final() was wrong.

No cluster differences.

gs/base/gsstruct.h


2013-06-12 12:39:13 -0700
Ray Johnston <ray.johnston@artifex.com>
f75e1cf3d4f4e4e809e94efc29b4046fe07f00c5

Fix Graydetection for pages after the first color page for cust 801.

We need to restore pageneutralcolor if graydetection is true, but also
we need to reestablish the monitoring color procedures, so we add a
gsicc_mcm_begin_monitor for the purpose. We change the pdf14 device
hook to allow the target device monitoring to be turned on or off.

gs/base/gdevp14.c
gs/base/gdevp14.h
gs/base/gdevprn.c
gs/base/gscms.h
gs/base/gsdevice.c
gs/base/gsicc_cache.c
gs/base/gsicc_cms.h
gs/base/gsicc_monitorcm.c
gs/base/gsicc_nocm.c
gs/base/gsicc_replacecm.c
gs/devices/gdevpbm.c


2013-06-13 08:12:35 +0100
Chris Liddell <chris.liddell@artifex.com>
5dd1d9a83d41ea9d2542e435172ff4fa7c163828

Bug 690639: change the order we do character mapping in TTFs

Instead of combining the encoding from the PDF with the Adobe Glyph List to
get a comprehensive list of glyph name mappings, then building a character
code to GID mapping from that, and (potentially) using the TTF post table to
fill in any gaps, we now build a mapping directly from the AGL, then (possibly)
fill in any gaps from the TTF post table, and *finally* fill in any remaining
gaps using the PDF's encoding.

This handles a case where the contents of the TTF cmap table don't match the
contents of the post table.

No cluster differences.

gs/Resource/Init/gs_ttf.ps


2013-06-11 18:51:18 +0100
Robin Watts <robin.watts@artifex.com>
e209e22862bd7af4362e08f1aa8f0025341356f0

Add tiffscaled32 device (32bpp CMYK output with downscaling)

Update documentation.

gs/base/gxdownscale.c
gs/base/macos-mcp.mak
gs/base/openvms.mak
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/devices/devs.mak
gs/devices/gdevtsep.c
gs/doc/Devices.htm
gs/psi/msvc.mak
main/pcl6_gcc.mak
main/pcl6_msvc.mak


2013-06-09 13:54:46 -0400
Chris Liddell <chris.liddell@artifex.com>
617143bb943a6540c751195c60b68387f2b06b88

Bug 694270: (valgrind) initialize structure

Initialize the Type 1 state structure before using it.

No cluster differences.

gs/devices/gxfcopy.c


2013-06-05 10:06:46 -0700
Michael Vrhel <michael.vrhel@artifex.com>
1cf483079386814249cfa831cfbe7491b59dc602

Fix for bug 694293. We are improperly clipping to the soft mask bounding box.

If the background alpha value for the softmask is something other than 0 we cannot
clip to the soft mask bounding box as regions that are outside this area will be
using the background alpha as their softmask value. Also, we were not accounting
for the different size of the softmask when compositing. Progressions occurred in
three test files with this fix in addition to fixing the customer file.

gs/base/gdevp14.c
gs/base/gxblend1.c


2013-05-16 14:52:31 +0100
Chris Liddell <chris.liddell@artifex.com>
61961d2828e427134f32a90f7477b4c91aae0c57

Bug 694065: address libtiff issues with WinRT build

The defaullt libtiff I/O functions use some methods proscribed in the WinRT world.

Ghostscript does not rely on these defaults, supplying our own I/O hooks
when we invoke libtiff.

So, if we're building libtiff into GS (as in the default and preferred
configuration), we leave out those default calls, and replace them with stubs
to keep the linker happy. Currently, these are empty stubs, and apply to all
builds, which may cause issues if anyone relies on linking to our built-in
libtiff, and uses these calls. If that proves to be the case, we can easily
fill-in the stubs with appropriate code, but working through the GS I/O
calls.

This also has the advantage that any port to a weird platform, we only
need to port the Ghostscript I/O, and we don't have to worry about libtiff.

If we're using a "shared" libtiff, these stubs are not included.

Unfortunately, libtiff does not pass around a context to the memory
management functions, so we currently still have no method of using the
Ghostscript memory manager.

Update to libpng 1.6.2

libpng 1.6.x dispenses with one of the function calls (lstrlenA) not allowed
in the WinRT build.

The other (ExitProcess) we work around in the makefiles, replacing it
with a simple "exit". This should never be a problem since we actually
rely on setjmp/longjmp for libpng error handling, and libpng code checks
for that option before it will get to the "exit" call.

Re-enable TIFF and PNG devices for WinRT

Rename 'PLATFORM' to 'GSPLATFORM'

nmake (at least in VS2012) defines 'PLATFORM' for certain configurations
which interfered with our use of it, so make it more Ghostscript-centric.

No cluster differences.

gs/base/gs.mak
gs/base/gstiffio.c
gs/base/gstiffio.h
gs/base/macos-mcp.mak
gs/base/msvclib.mak
gs/base/openvms.mak
gs/base/openvms.mmk
gs/base/png.mak
gs/base/tiff.mak
gs/base/unixhead.mak
gs/base/winlib.mak
gs/configure.ac
gs/devices/devs.mak
gs/devices/gdevtfax.c
gs/devices/gdevtfnx.c
gs/devices/gdevtifs.c
gs/devices/gdevtifs.h
gs/devices/gdevtsep.c
gs/libpng/ANNOUNCE
gs/libpng/CHANGES
gs/libpng/CMakeLists.txt
gs/libpng/INSTALL
gs/libpng/LICENSE
gs/libpng/Makefile.am
gs/libpng/Makefile.in
gs/libpng/README
gs/libpng/aclocal.m4
gs/libpng/arm/arm_init.c
gs/libpng/arm/filter_neon.S
gs/libpng/autogen.sh
gs/libpng/config.guess
gs/libpng/config.h.in
gs/libpng/config.sub
gs/libpng/configure.ac
gs/libpng/contrib/examples/README.txt
gs/libpng/contrib/examples/iccfrompng.c
gs/libpng/contrib/examples/pngpixel.c
gs/libpng/contrib/examples/pngtopng.c
gs/libpng/contrib/gregbook/Makefile.sgi
gs/libpng/contrib/gregbook/Makefile.unx
gs/libpng/contrib/gregbook/readpng.c
gs/libpng/contrib/gregbook/readpng2.c
gs/libpng/contrib/gregbook/writepng.c
gs/libpng/contrib/libtests/fakepng.c
gs/libpng/contrib/libtests/gentests.sh
gs/libpng/contrib/libtests/makepng.c
gs/libpng/contrib/libtests/pngstest.c
gs/libpng/contrib/libtests/pngunknown.c
gs/libpng/contrib/libtests/pngvalid.c
gs/libpng/contrib/libtests/readpng.c
gs/libpng/contrib/libtests/tarith.c
gs/libpng/contrib/libtests/timepng.c
gs/libpng/contrib/pngminim/README
gs/libpng/contrib/pngminim/decoder/makefile
gs/libpng/contrib/pngminim/decoder/pngusr.dfa
gs/libpng/contrib/pngminim/decoder/pngusr.h
gs/libpng/contrib/pngminim/encoder/README
gs/libpng/contrib/pngminim/encoder/makefile
gs/libpng/contrib/pngminim/encoder/pngusr.dfa
gs/libpng/contrib/pngminim/encoder/pngusr.h
gs/libpng/contrib/pngminim/preader/makefile
gs/libpng/contrib/pngminim/preader/pngusr.dfa
gs/libpng/contrib/pngminim/preader/pngusr.h
gs/libpng/contrib/pngminus/makefile.std
gs/libpng/contrib/pngminus/png2pnm.c
gs/libpng/contrib/pngminus/pnm2png.c
gs/libpng/contrib/pngsuite/README
gs/libpng/contrib/pngsuite/ftbbn0g01.png
gs/libpng/contrib/pngsuite/ftbbn0g02.png
gs/libpng/contrib/pngsuite/ftbbn0g04.png
gs/libpng/contrib/pngsuite/ftbbn1g04.png
gs/libpng/contrib/pngsuite/ftbwn0g16.png
gs/libpng/contrib/pngsuite/ftbwn1g16.png
gs/libpng/contrib/pngsuite/ftp0n0g08.png
gs/libpng/contrib/pngsuite/ftp0n1g08.png
gs/libpng/contrib/tools/README.txt
gs/libpng/contrib/tools/checksum-icc.c
gs/libpng/contrib/tools/chkfmt
gs/libpng/contrib/tools/cvtcolor.c
gs/libpng/contrib/tools/fixitxt.c
gs/libpng/contrib/tools/intgamma.sh
gs/libpng/contrib/tools/makesRGB.c
gs/libpng/contrib/tools/sRGB.h
gs/libpng/contrib/visupng/PngFile.c
gs/libpng/contrib/visupng/PngFile.h
gs/libpng/contrib/visupng/VisualPng.c
gs/libpng/depcomp
gs/libpng/example.c
gs/libpng/install-sh
gs/libpng/libpng-config.in
gs/libpng/libpng-manual.txt
gs/libpng/libpng.3
gs/libpng/libpngpf.3
gs/libpng/ltmain.sh
gs/libpng/missing
gs/libpng/png.5
gs/libpng/png.c
gs/libpng/png.h
gs/libpng/pngconf.h
gs/libpng/pngerror.c
gs/libpng/pngget.c
gs/libpng/pnginfo.h
gs/libpng/pngmem.c
gs/libpng/pngpread.c
gs/libpng/pngpriv.h
gs/libpng/pngread.c
gs/libpng/pngrio.c
gs/libpng/pngrtran.c
gs/libpng/pngrutil.c
gs/libpng/pngset.c
gs/libpng/pngstruct.h
gs/libpng/pngtest.c
gs/libpng/pngtest.png
gs/libpng/pngtrans.c
gs/libpng/pngwio.c
gs/libpng/pngwrite.c
gs/libpng/pngwtran.c
gs/libpng/pngwutil.c
gs/libpng/projects/owatcom/libpng.wpj
gs/libpng/projects/owatcom/pngstest.tgt
gs/libpng/projects/visualc71/README.txt
gs/libpng/projects/visualc71/libpng.vcproj
gs/libpng/projects/visualc71/pngtest.vcproj
gs/libpng/projects/vstudio/WARNING
gs/libpng/projects/vstudio/libpng/libpng.vcxproj
gs/libpng/projects/vstudio/pnglibconf/pnglibconf.vcxproj
gs/libpng/projects/vstudio/pngstest/pngstest.vcxproj
gs/libpng/projects/vstudio/pngtest/pngtest.vcxproj
gs/libpng/projects/vstudio/pngunknown/pngunknown.vcxproj
gs/libpng/projects/vstudio/pngvalid/pngvalid.vcxproj
gs/libpng/projects/vstudio/readme.txt
gs/libpng/projects/vstudio/vstudio.sln
gs/libpng/projects/vstudio/zlib.props
gs/libpng/projects/vstudio/zlib/zlib.vcxproj
gs/libpng/scripts/README.txt
gs/libpng/scripts/checksym.awk
gs/libpng/scripts/chkfmt
gs/libpng/scripts/def.dfn
gs/libpng/scripts/descrip.mms
gs/libpng/scripts/dfn.awk
gs/libpng/scripts/intprefix.dfn
gs/libpng/scripts/libpng-config-head.in
gs/libpng/scripts/libpng.pc.in
gs/libpng/scripts/libtool.m4
gs/libpng/scripts/ltoptions.m4
gs/libpng/scripts/ltsugar.m4
gs/libpng/scripts/ltversion.m4
gs/libpng/scripts/lt~obsolete.m4
gs/libpng/scripts/macro.lst
gs/libpng/scripts/makefile.32sunu
gs/libpng/scripts/makefile.64sunu
gs/libpng/scripts/makefile.aix
gs/libpng/scripts/makefile.bc32
gs/libpng/scripts/makefile.beos
gs/libpng/scripts/makefile.bor
gs/libpng/scripts/makefile.cegcc
gs/libpng/scripts/makefile.darwin
gs/libpng/scripts/makefile.dec
gs/libpng/scripts/makefile.dj2
gs/libpng/scripts/makefile.elf
gs/libpng/scripts/makefile.freebsd
gs/libpng/scripts/makefile.gcc
gs/libpng/scripts/makefile.hp64
gs/libpng/scripts/makefile.hpgcc
gs/libpng/scripts/makefile.hpux
gs/libpng/scripts/makefile.ibmc
gs/libpng/scripts/makefile.intel
gs/libpng/scripts/makefile.knr
gs/libpng/scripts/makefile.linux
gs/libpng/scripts/makefile.mips
gs/libpng/scripts/makefile.msc
gs/libpng/scripts/makefile.msys
gs/libpng/scripts/makefile.ne12bsd
gs/libpng/scripts/makefile.netbsd
gs/libpng/scripts/makefile.openbsd
gs/libpng/scripts/makefile.sco
gs/libpng/scripts/makefile.sggcc
gs/libpng/scripts/makefile.sgi
gs/libpng/scripts/makefile.so9
gs/libpng/scripts/makefile.solaris
gs/libpng/scripts/makefile.solaris-x86
gs/libpng/scripts/makefile.std
gs/libpng/scripts/makefile.sunos
gs/libpng/scripts/makefile.tc3
gs/libpng/scripts/makefile.vcwin32
gs/libpng/scripts/makevms.com
gs/libpng/scripts/options.awk
gs/libpng/scripts/pnglibconf.dfa
gs/libpng/scripts/pnglibconf.h.prebuilt
gs/libpng/scripts/pnglibconf.mak
gs/libpng/scripts/prefix.dfn
gs/libpng/scripts/sym.dfn
gs/libpng/scripts/symbols.def
gs/libpng/scripts/symbols.dfn
gs/libpng/scripts/vers.dfn
gs/libpng/test-driver
gs/libpng/test-pngtest.sh
gs/libpng/test-pngvalid-full.sh
gs/libpng/test-pngvalid-simple.sh
gs/libpng/tests/pngstest
gs/libpng/tests/pngstest-0g01
gs/libpng/tests/pngstest-0g02
gs/libpng/tests/pngstest-0g04
gs/libpng/tests/pngstest-0g08
gs/libpng/tests/pngstest-0g16
gs/libpng/tests/pngstest-2c08
gs/libpng/tests/pngstest-2c16
gs/libpng/tests/pngstest-3p01
gs/libpng/tests/pngstest-3p02
gs/libpng/tests/pngstest-3p04
gs/libpng/tests/pngstest-3p08
gs/libpng/tests/pngstest-4a08
gs/libpng/tests/pngstest-4a16
gs/libpng/tests/pngstest-6a08
gs/libpng/tests/pngstest-6a16
gs/libpng/tests/pngstest-error
gs/libpng/tests/pngtest
gs/libpng/tests/pngunknown-IDAT
gs/libpng/tests/pngunknown-discard
gs/libpng/tests/pngunknown-if-safe
gs/libpng/tests/pngunknown-sAPI
gs/libpng/tests/pngunknown-sTER
gs/libpng/tests/pngunknown-save
gs/libpng/tests/pngunknown-vpAg
gs/libpng/tests/pngvalid-gamma-16-to-8
gs/libpng/tests/pngvalid-gamma-alpha-mode
gs/libpng/tests/pngvalid-gamma-background
gs/libpng/tests/pngvalid-gamma-expand16-alpha-mode
gs/libpng/tests/pngvalid-gamma-expand16-background
gs/libpng/tests/pngvalid-gamma-expand16-transform
gs/libpng/tests/pngvalid-gamma-sbit
gs/libpng/tests/pngvalid-gamma-threshold
gs/libpng/tests/pngvalid-gamma-transform
gs/libpng/tests/pngvalid-progressive-interlace-size
gs/libpng/tests/pngvalid-progressive-interlace-standard
gs/libpng/tests/pngvalid-progressive-interlace-transform
gs/libpng/tests/pngvalid-progressive-standard
gs/libpng/tests/pngvalid-standard
gs/psi/msvc.mak
gs/psi/os2.mak


2013-06-05 08:17:22 +0100
Ken Sharp <ken.sharp@artifex.com>
0de588b3705131067078d9cac84d5bc6ff0a77e9

pdfwrite - squelch a couple of minor compiler warnings

No differences expected

gs/devices/vector/gdevpdfg.c


2013-06-04 13:46:07 -0700
Ray Johnston <ray.johnston@artifex.com>
1271b370117a9622fc255df665c007487e16296f

Fix bug 694290 caused by an image totally off the page.

This went away with the change to clipping, commit e0ba422, but we
might as well fix this long standing issue as well.

gs/base/gxclimag.c


2013-06-04 13:01:21 -0700
Ray Johnston <ray.johnston@artifex.com>
55fbadd981f3ca78f0920342a7ebaca4eab20cfa

Fix SEGV when -ZL is used.

The stream state memory is NULL, so use local_memory when printing.

gs/base/gxclread.c


2013-06-04 10:52:14 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
d38f691578b52aa954ec9354b59919026d7e46f7

Fixed GhostPCL -DPACIFY_VALGRIND missing symbol issue.

pl/plplatf.c


2013-06-04 18:34:45 +0100
Ken Sharp <ken.sharp@artifex.com>
7719dd1084cf57cb415b8a64ea2ee09a6eb39ee2

pdfwrite - silence valgrind warning

Bug #694267
"Valgrind issues found by fuzzing in process_text_modify_width (gdevpdte.c:1104)"

I'm pretty sure this is functionally benign because the values read are not
actually used, but setting them to zero silences the warning.

No differences expected.

gs/devices/vector/gdevpdtt.c


2013-06-04 13:14:52 +0100
Ken Sharp <ken.sharp@artifex.com>
549cf6ae1bf57fc8d84d0598f04a861378e0e5ea

pdfwrite - colour management, convert Separation and DeviceN base spaces

When the input is DeviceN or Separation, the color conversion strategy is
Gray, RGB or CMYK, and the alternate space is not compatible, convert the
alternate space. We do this by constructing either an exponential (Separation)
or sampled (DeviceN) function, we sample the end points of each ink,
convert the alternate space representation to the requested device space
and use those as the data points ofr the function.

The representation probably isn't that great, since it linearly interpolates
between the (very few) sample points, but it does the job adequately, and
preserves the Separation/DeviceN space while still creating an appropriate
colour space in the output.

No differences expected, this code not in use yet.

gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfc.h
gs/devices/vector/gdevpdfg.c


2013-06-04 09:44:33 +0100
Ken Sharp <ken.sharp@artifex.com>
662c5022b6731a4cff0c026c0ef62322aaaf396c

pdfwrite - additional error checking on named destinations

Bug #694194 "Seg faults found by fuzzing in pdfmark_DOCVIEW"

The routine for creating a named destination could return an error if the
destination page was outside the valid range (-2 in this case), but the
DOCVIEW pdfmark wasn't testing the returned value.

Added code to give a meaningful error and return a rangecheck error when this
occurs.

No differences expected.

gs/devices/vector/gdevpdfm.c


2013-06-03 13:10:10 -0700
Ray Johnston <ray.johnston@artifex.com>
e0ba4228f11f9a5af359915878176efee8dc73f5

Fix clipping bugs 693509 and 690036.

The Adobe scan conversion rules call for the clip path to use the same
rule as for filling. Thus we need to apply the 'adjust' to do the any part
of pixel rule. Differences are expected, but bmpcmp doesn't show any.

gs/base/gxcpath.c


2013-06-03 08:31:56 +0100
Chris Liddell <chris.liddell@artifex.com>
761e413514c7f9374f54e8ffef3c1d7ebf824e28

Bug 694272: bounds check TTF outline points flags

Reading the points "flags" from the TTF stream, we weren't bounds checking when
the flag value is a repeated one, so we could trundle off the end of the buffer.

No cluster differences.

gs/base/ttfmain.c


2013-05-31 09:46:10 -0700
Ray Johnston <ray.johnston@artifex.com>
1eef08f4aaf485a18422e9fbcfd6ac8cbfb03cdb

Temporarily disable BGPrint for the cups device until differences fixed.

By using gdev_prn_output_page background printing is not performed.

gs/cups/gdevcups.c


2013-05-30 15:48:33 -0700
Michael Vrhel <michael.vrhel@artifex.com>
483e100c06e647d8ba2d68beef09c1c241fd328d

Addition of ETS code and project into gs/toolbin/halftone

gs/toolbin/halftone/ETS/COPYING.txt
gs/toolbin/halftone/ETS/Makefile_avec
gs/toolbin/halftone/ETS/Makefile_sse2
gs/toolbin/halftone/ETS/README.txt
gs/toolbin/halftone/ETS/_eb_sse2.s
gs/toolbin/halftone/ETS/build.bat
gs/toolbin/halftone/ETS/eb_avec.c
gs/toolbin/halftone/ETS/eb_avec.h
gs/toolbin/halftone/ETS/eb_sse2.s
gs/toolbin/halftone/ETS/ei03.pdf
gs/toolbin/halftone/ETS/ets.c
gs/toolbin/halftone/ETS/ets.h
gs/toolbin/halftone/ETS/ipview.html
gs/toolbin/halftone/ETS/test_ets.c
gs/toolbin/halftone/ETS/tm.h
gs/toolbin/halftone/ETS/win32/ETS.sln
gs/toolbin/halftone/ETS/win32/ETS.vcproj


2013-05-30 15:40:34 -0700
Michael Vrhel <michael.vrhel@artifex.com>
69cce78d20f9ee34954812e72ad6f3e4bf085374

Addition of -dPreBandThreshold information into documentation

gs/doc/Use.htm


2013-05-29 21:59:45 -0700
Ray Johnston <ray.johnston@artifex.com>
0c55548b5fbf6fabdc7c5766c162b0cd67597627

Fix incorrect Gray Detection on pages after the first color page.

Reported by customer 801. The pageneutralcolor element of the icc_struct
was not being reset, so once it was set for 'color' all subsequent pages
would be seen as color.

gs/base/gdevprn.c


2013-05-30 13:47:20 +0100
Chris Liddell <chris.liddell@artifex.com>
b09746cd4c822c2a72f146e74ff48c4ca4a94807

Bug 694059: support all available TIFF compressions

Previously, we weren't allowing certain valid (but possibly not terribly
sensible) combinations of bit depth and compression - for those, tiffsep
would silently ignore the setting and use a default.

This has been relaxed, although certain combinations are not supported by
libtiff are still proscribed (CRLE/G4/G3 and multibit per sample - for
example, 8 bits per sample cannot be combined with CCITT Group 4 fax).
Those now generate an error message and a rangecheck error.

No cluster differences.

gs/devices/gdevtifs.c
gs/devices/gdevtsep.c


2013-05-30 14:41:07 +0200
Till Kamppeter <till.kamppeter@gmail.com>
c374882e38fdac7ef766c9ac1ec8674e02bd56bc

Added support for printer calibration to the gstoraster CUPS filter

For doing calibration printouts the color management in the print filter
chain needs to get turned off. This is done by calling Ghostscript with the
"-dUseFastColor" command line option. Inhibiting color management can be done
via colord, with a command like

colormgr device-inhibit /org/freedesktop/ColorManager/devices/<printer> 0

or by sending the calibration print job with the option "color-management=off".

Thanks to Richard Hughes for the patch.

gs/cups/colord.c
gs/cups/colord.h
gs/cups/gstoraster.c


2013-05-29 11:24:02 -0700
Ray Johnston <ray.johnston@artifex.com>
89c224b029357002c48660dae98de2d1e560d4e0

Fix for too many entries in an image Decode array reported by cust 532.

This is an out-of spec file, but as usual, since Adobe handles it, so we do too.
Allow too many by setting over_error to 0 when we load the Decode array.

This required a change to dict_float_array_param so that it will load the
requested number of elements (and return that count) when over_erro == 0.

Also clean up the indenting and get rid of the unused decode_size variable.

gs/psi/idparam.c
gs/psi/zimage.c


2013-05-29 11:46:45 -0700
Ray Johnston <ray.johnston@artifex.com>
6ceadc6f2da001b183d700186e6b5e622bcb22cf

Add missing include when GS_NO_UTF8=1

gs/base/gp_wgetv.c


2013-05-29 17:24:32 +0100
Ken Sharp <ken.sharp@artifex.com>
2d04d5942b3e97b06a7ac4ed767a6c481d4421f4

pdfwrite - improve handling of Unicode names

Bug#694277 " Improve pdfmark processing to handle unusual names in named destinations"

We can't handle Unicode names in PDF, technically we should write these as
strings and enter them in the names table, but we don't have a mechanism for
that for pdfmarks.

Instead we leave them as names using the special processing in pdfwrite, but
extended with additional markers. When writing these out pdfwrite converts
the NULLs to an arbitrary string. This works adequately for the bug as
these are named destinations, but its possible that other kinds of names
might be visible in the PDF application and would give the wrong result.

So this is at best a patch.

No differences expected.

gs/Resource/Init/gs_pdfwr.ps
gs/devices/vector/gdevpdfr.c
gs/devices/vector/gdevpdfu.c


2013-05-28 11:17:21 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
c2503db1c461d7d3af7c8f69a193fb978d8377b3

Bug 694138: Fix component number validation in ICC colorspace

gs/psi/zcolor.c


2013-05-24 17:40:42 +0100
Robin Watts <robin.watts@artifex.com>
69ea64d08a97da7afcfb0790f916f1ff4adf115e

Fix MuPDF fuzzing SEGV

Move the indexing of an array AFTER the check for whether the
index is suitable.

gs/jbig2dec/jbig2_text.c


2013-05-24 16:22:47 +0100
Robin Watts <robin.watts@artifex.com>
f40a8ab6a7326d1643852e7c9049a9b875131824

JBIG2Dec: MUPDF fuzzing SEGV fixes

The changes herein solve SEGVs (and valgrind failures) seen when
fuzzing mupdf. The following are some files that show these up:

tests_private/fuzzing/mupdf/280.pdf.SIGSEGV.93c.2002
tests_private/fuzzing/mupdf/1112.pdf.SIGSEGV.9ab.128
tests_private/fuzzing/mupdf/1136.pdf.SIGSEGV.93c.154

gs/jbig2dec/jbig2_generic.c
gs/jbig2dec/jbig2_symbol_dict.c


2013-05-27 09:23:35 +0100
Ken Sharp <ken.sharp@artifex.com>
c00e028429fa7bbbe1f3902286d5b3710b670815

pdfwrite - better support for PageLabels

Bug #693929 " Regression: Error: /undefined in --run--"

This code now properly flattens a PageLabels number tree into a single node
tree, which it converts to a string for inclusion in the output.

In addition to flattening the tree we also perform considerable error checking
on the tree construction, and we limit the number of page elements to 1000.
This is because PostScript strings are limited to 64k and we use a string to
pass the data to the device for inclusion. If we exceed 1000 elements then
we simply abort the PageLabels (and print a warning on the back channel)

No differences expected, this is not a printing eleent

gs/Resource/Init/gs_pdfwr.ps


2013-05-26 13:08:46 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
3282874fbe636652df435fdacef4ebc3f3ee426b

Bug 694087: Detect and correct wrong /Subtype of CID font

This attribute appears to be tested again somewhere else.
Changing the attribute to the correct value clears the bug.

gs/Resource/Init/pdf_font.ps


2013-05-26 03:01:24 -0400
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9567219b7bd46b1d8a7cfc318788e7dc24bebc21

Bug 694021: Patch for seg fault related issues

The seg fault is due to the the image decoder trying to use an uninitialized
GR_stats. This also uncovered a few other errors that are covered here :-
1) GR_stats is now initialised in all places to prevent it reaching
jbig2_arith_decode with fake values
2) jbig2_arith_decode has been updated to prevent access outside of the
jbig2_arith_Qe array which now returns an error in such cases.
3) all uses of jbig2_decode_refinement_region now check for a returning error
and act accordingly.

gs/jbig2dec/jbig2_arith.c
gs/jbig2dec/jbig2_symbol_dict.c
gs/jbig2dec/jbig2_text.c


2013-05-26 02:02:38 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
7131b2045a957089f2c7eec227c23f5fbe4ee1e7

Bug 694100: Fix yet another automatic PDF file closure.

Read PDF file more carefully during testing for the stream xref
and validate the tokens to avoid reading past the EOF and
closing the file.

gs/Resource/Init/pdf_main.ps


2013-05-24 16:17:45 +0100
Ken Sharp <ken.sharp@artifex.com>
2f08dfcd4db7f6a95ac9ee983692d922c09a1ffd

pdfwrite - ignore overly complex PageLabels for now

The current PageLabels code doesn't handle anything except the simplest
case (/Nums at the page tree root), so ignore anything more complex so
that we don't throw an error.

More work to do, I want to handle a proper tree.

No differences expected.

gs/Resource/Init/gs_pdfwr.ps


2013-05-24 16:02:21 +0100
Chris Liddell <chris.liddell@artifex.com>
66695586781291ca37d190c537784ccf94595428

Add trio directory to zip archive target.

CLUSTER_UNTESTED

gs/psi/winint.mak


2013-05-24 13:41:41 +0100
Chris Liddell <chris.liddell@artifex.com>
735c3bbfecc9bbb5792c85558b4641568e316b9d

Bug 691784 - jbig2dec WIN32 DLL with configure

See http://bugs.ghostscript.com/show_bug.cgi?id=691784

CLUSTER_UNTESTED

gs/jbig2dec/configure.ac


2013-05-21 00:47:46 +0100
Robin Watts <robin.watts@artifex.com>
b44040bb9550d403313baec2bed084f1de50093a

Fix typo in previous commit.

I'd forced the valgrind code on to ensure it was tested, and forgot to
disable it before commit.

gs/base/gxclipm.c


2013-05-20 19:18:36 +0100
Robin Watts <robin.watts@artifex.com>
94bf81402c991ca8feb59012078b19b5b5d6a5dd

Bug 693803: Add PACIFY_VALGRIND code for clip_runs_enumerate.

gs/base/gxclipm.c


2013-05-20 15:10:07 +0100
Robin Watts <robin.watts@artifex.com>
ebbcd5b9e67b45c8d7187730d131ff43060aa247

Bug 693807: Add PACIFY_VALGRIND code to mem_true32_copy_mono.

Mask of uninitialised bits at the end of a tile row.

gs/base/gdevm32.c


2013-05-17 11:02:12 -0700
Robin Watts <robin@peeves.(none)>
54683cf9303c3b9146492a9a3a5f5fbc3a7521bc

Bug 693965: Fix SEGV in fuzzing test (corrupt image)

Second attempt to commit this; the first time had a typo in.

The first error given by valgrind is due to the image in this
file being a 16bpp one with a horizontal flip. This tickles
an incomplete case within the interpolation code. Not
surprising as there are more options in that code than anyone
should be expected to cope with. The code is fixed here.

This leads on to the cause of the crash; the image has a matrix
with a HUGE x shift on it. This upsets some of the floating
point calculations used to calculate the render rectangle.

This code has been hardened now to cope with such errors.

gs/base/gxipixel.c
gs/base/gxiscale.c


2013-05-20 12:14:00 +0100
Robin Watts <robin.watts@artifex.com>
0956abfbb0b53ecd1e8e276d6b2c603a720e6187

Revert "Bug 693965: Fix SEGV in fuzzing test (corrupt image)"

This reverts commit 1f80c02083b222e3f005c46e91ab4597de323371. Committed
too early, sorry.

gs/base/gxipixel.c
gs/base/gxiscale.c


2013-05-20 09:30:18 +0100
Ken Sharp <ken.sharp@artifex.com>
a8487e333554f19bf8d529b9e7893ad4e16448d1

Ensure that PCL bitmap glyphs with no data still execute setcachedevice

This grew out of Bug #694069, in the course of resolving that problem it
transpired that, if there was no data available for a downloaded bitmap
character, the PCL interpreter simply returned.

In conjunction with pdfwrite, this caused an endless loop due to the character
cache being overfilled. We only check the availability of space in the
character cache in setcachedevice, so its safer to make sure that we do
call it, thereby avoiding the overfilling.

No differences expected.

pl/plchar.c


2013-05-18 14:42:23 -0700
Ray Johnston <ray.johnston@artifex.com>
36f1de9b5a937d535cb44bb088572b76a9c5bcbd

Fix BGPrint mode (copy_paste error that disabled background printing.

gs/base/gdevprn.c


2013-05-17 11:02:12 -0700
Robin Watts <robin@peeves.(none)>
1f80c02083b222e3f005c46e91ab4597de323371

Bug 693965: Fix SEGV in fuzzing test (corrupt image)

The first error given by valgrind is due to the image in this
file being a 16bpp one with a horizontal flip. This tickles
an incomplete case within the interpolation code. Not
surprising as there are more options in that code than anyone
should be expected to cope with. The code is fixed here.

This leads on to the cause of the crash; the image has a matrix
with a HUGE x shift on it. This upsets some of the floating
point calculations used to calculate the render rectangle.

This code has been hardened now to cope with such errors.

gs/base/gxipixel.c
gs/base/gxiscale.c


2013-05-16 07:34:06 +0100
Chris Liddell <chris.liddell@artifex.com>
f0ff05b449b4ecc9332029faf7e7b186b3e18052

Add words about shared libs on OS X.

CLUSTER_UNTESTED

gs/doc/Make.htm


2013-05-15 06:54:53 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
eccbb7c6c0c267f6e3b7a2381b0b019140f3d831

Added singlePagePDF mode to clusterpush.pl.

gs/toolbin/localcluster/clusterpush.pl


2013-05-14 16:28:22 -0600
Henry Stiles <henry.stiles@artifex.com>
853678e7bd4303cd5a1b5e74dfe257fd896a106c

Remove obsolete USECIEColor option in PCL and PXL.

pcl/pccid.c
pcl/pcstate.h
pl/pjparse.c
pxl/pxcet.txt
pxl/pximage.c
pxl/pxink.c
pxl/pxpthr.c
pxl/pxsessio.c
pxl/pxstate.h


2013-05-14 15:33:24 -0600
Henry Stiles <henry.stiles@artifex.com>
593afcba2b670c6b1051d39d2a73ce1b386b871c

Remove obsolete scripts

pxl/pxprint.bat
pxl/pxprint.tcl


2013-05-14 17:39:47 +0100
Robin Watts <robin.watts@artifex.com>
397e20418223e2faba856ae80e7945faa1a10e99

Add gsicc_monitorcm.c to Win32 project.

gs/ghostscript.vcproj


2013-05-14 17:24:57 +0100
Ken Sharp <ken.sharp@artifex.com>
37b08e30586434098c9f6b8dc35fa25de39f468d

pdfwrite - when using %d in OutputFile, empty glyphs from cache

Bug #694069

When we are using '%d' in the Output File Name, we throw away the PDF font
resource after every page, but the intperpreter glyph cache remains filled.

This is a problem for type 3 fonts (specifically their PCL equivalents), as
we won't rerun the glyph description to capture it for a type 3 font, so
the glyphs don't get captured.

To solve this we empty any existing cache entry before attempting to run the
glyph. This runs into some more awkwardness with a specific kind of broken
font (no chacracter data) in some QL test files. We work around that too.

gs/devices/vector/gdevpdtt.c


2013-05-14 11:04:02 +0100
Chris Liddell <chris.liddell@artifex.com>
e76dc46756e89a14a3348bce12a633d32e4fa831

Allow command line override for endian setting.

Due bugs in certain versions of autoconf, we use an explicit check for
endianness instead of the built-in macro. This can result in problems when
cross compiling.

This override allows command line options to pre-empt the explicit check.

No cluster differences.

configure.ac
gs/configure.ac


2013-05-14 09:27:08 +0100
Ken Sharp <ken.sharp@artifex.com>
4692f1abb037f49bd5158fb6a988076fdc14754d

pdfwrite - really make all TrueType fonts symbolic

If we don't subset TrueType fonts, we still want to mark them as symbolic,
because we never emit a /Encoding, and without that Acrobat (but not
other readers) is unable to display some glyphs correctly.

No differences expected.

gs/devices/vector/gdevpdtd.c


2013-05-11 16:30:36 -0700
Ray Johnston <ray.johnston@artifex.com>
c03495a2c2df7f03d537dbbd53aedc014e0577d0

Add documentation for BGPrint and GrayDetection.

gs/doc/Language.htm


2013-05-09 20:47:31 -0700
Ray Johnston <ray.johnston@artifex.com>
7a8612112478196d8f047a556fdbb15d17aec7d0

Add PSFitPage and FitPage options to allow fitting PS files to a page.

The FitPage option is added as a convenience to set all three *FitPage
options, so -dFitPage is the same as -dEPSFitPage -dPDFFitPage -dPSFitPage.
The -dPSFitPage option is new and works by establishing the default
Polcies PageSize to 13.

When the Policy is 3 or 13, the page size matching logic rotates, scales,
and center a PostScript file's requested page size on the best fit medium.
When the Policy is 13, the the match_page_size enables the scaling down
(as with Policy 3) as well as up.

Only populate the InputAttr dictionary with the current page size if
FIXEDMEDIA is set (explicitly, or impiled by -g) so that only that
page size is available for match_page_size.

When the policy is 13, we enable the PageSize in the setpagedevice
merged request even if FIXEDMEDIA is set.

The make_adjustment_matrix has the check for factor < 1 removed since
this is accounted for in the caller setting the 'scale' boolean (larger).

The documentation in doc/Use.htm is updated for both the -dPSFitPage
option and the -dFitPage option.

gs/Resource/Init/gs_init.ps
gs/Resource/Init/gs_setpd.ps
gs/doc/Use.htm
gs/psi/zmedia2.c


2013-05-13 17:03:47 +0100
Chris Liddell <chris.liddell@artifex.com>
790240763991cf42b98b37c9dec22bf67df4c90d

Use the srcdir variable in configure for Luratech

One of the Luratech paths in the configure script wasn't using the srcdir
variable so would not work correctly for "out of tree" building.

No cluster differences.

gs/configure.ac


2013-05-11 10:30:46 +0100
Ken Sharp <ken.sharp@artifex.com>
606f3279e00ae250bf883ce45b90d276943ffe84

pdfwrite - don't cache high level pattern filled glyphs

Bug #693946 "High level pattern commit causes a regression"

If we use the cache when a glyph is filled with a high level pattern we will
get incorrect rendering, as the pattern was not passed down to the low level
routines. So make sure we don't cache glyphs under these conditions, nor
consult the cache for existing cached glyphs.

Expected Differences
14-07.bin and 19-10.bin should now work correctly

gs/devices/vector/gdevpdtt.c


2013-05-10 09:57:00 +0100
Ken Sharp <ken.sharp@artifex.com>
32954e1a310eb4a3673a0eb815be8d618e17aad4

epswrite - flush stream before writing page trailer

Bug #694061 "epswrite generates bad file"

The code (quite deliberately) writes the page trailer *directly to the file*
before flushing the stream. This resulted in the page trailer being emitted
part way through a path construction and fill. The fill is completed by the
flushing of the stream.

In this commit we flush the stream first.

No differences expected, the cluster does not test epswrite.

gs/devices/vector/gdevps.c


2013-05-10 08:31:44 +0100
Ken Sharp <ken.sharp@artifex.com>
ca6408d4bda6c899374984ba7705e734ff6c9d59

documentation - remove duplicated epswrite section in devices.htm

gs/doc/Devices.htm


2013-05-09 09:43:34 +0100
Chris Liddell <chris.liddell@artifex.com>
1f5bc0eb4bbb1c9512f8c63e953b9d2cd76ca563

Bug 693964: handle missing FistChar and Widths

When tailoring scaling a substitute font (based on the Widths array),
handle non-spec compliant files which are missing FirstChar and Width
entries from FontDescriptor dictionaries for non-base14 fonts.

No cluster differences.

gs/Resource/Init/pdf_font.ps


2013-05-08 17:00:27 -0700
Robin Watts <robin@peeves.(none)>
3aa5eb75e645d70f315193869179ec88ff20691c

Bug 693377: Fix warning in rinkj device due to pointer cast.

Cast via size_t to avoid warning.

gs/devices/rinkj/evenbetter-rll.c


2013-05-08 20:28:46 +0000
Robin Watts <robin.watts@artifex.com>
d8926b7746b8acbf870b3aed93ba2a4ee799e94b

Bug 693377: Fix some 32bit specific warnings in gdevmjc.c

gs/contrib/japanese/gdevmjc.c


2013-05-08 13:24:14 -0700
Robin Watts <robin@peeves.(none)>
d838c5de6baa30cec31542ae8998fe3d3a5e4b31

Bug693377: Squash some warnings in libtiff

Avoid warnings about casting pointer to int of a different size
by casting via size_t. Should be ptrdiff_t really, but we don't
have that in all cases.

gs/tiff/libtiff/tif_unix.c


2013-05-08 19:25:36 +0100
Robin Watts <robin.watts@artifex.com>
040915cc3ab82a9b0be77fa4dd27caa330f2ab5c

Squash some warnings.

In gs/base/gsroprun1.h we cast a pointer to an int and then & 3
to find alignment. Given ints are always > 2 bits, this is always
safe, but the compiler whinges anyway. We'd like to use ptrdiff_t
instead to avoid the whinging, but it's not defined. So define
our own using the ARCH_ macros.

In gs/base/gxclrect.c, we check for the size of a type, and then
shift down by it. The compiler complains that the shift may be
too large to be defined in C, not realising that this is precisely
what we have just checked. We work around this by shifting in 2
stages.

gs/base/gsroprun1.h
gs/base/gxclrect.c


2013-05-08 11:16:05 -0600
Henry Stiles <henry.stiles@artifex.com>
ae3839979568fcb7e4a158cff48eed037830878a

Miscellaneous warning and scan build fixes.

gs/devices/gdevpxut.c
gs/devices/vector/gdevsvg.c
pcl/pcsfont.c
pcl/pctext.c
pxl/pxsessio.c


2013-05-08 13:13:02 +0100
Paul Gardiner <paul@glidos.net>
b652073e14ebfccf7324ae05f9bf871502560bf4

WinRT: add build instructions

gs/doc/Make.htm


2013-05-08 13:31:22 +0100
Chris Liddell <chris.liddell@artifex.com>
4b4cde01cf5be3d9caa813532ca93603a36d2f20

Bug 688949: allow Ghostscript to build outside src tree

These changes allow you to run the Ghostscript configure script and make from
outside the source tree. Allowing the use of a "build directory" so the
source directory stays unadulterated.

The cluster test through up a load of compiler warnings, but none of them are
new, as far as I can tell.

No cluster differences.

gs/Makefile.in
gs/configure.ac
gs/cups/cups.mak
gs/devices/devs.mak


2013-05-07 17:11:19 -0600
Henry Stiles <henry.stiles@artifex.com>
9eb9408b3ccfdb8f0cf54d8ca9adcc79a102319a

Fix 693412 fix duplex and number of copies interaction.

Add pcl duplex command if the page count is divisible by the number of
copies not the raw page count to properly collate duplexing jobs.
Patch contributed by Binaria Digital.

gs/devices/gdevdljm.c


2013-05-07 15:40:50 +0100
Paul Gardiner <paul@glidos.net>
9429a2dbfe6609939185970beb4789bd438624af

Support building for WinRT

.gitignore
gs/base/gp_msdll.c
gs/base/gp_mswin.c
gs/base/gp_ntfs.c
gs/base/gp_win32.c
gs/base/gp_wpapr.c
gs/base/gp_wsync.c
gs/base/windows_.h
gs/base/winrtsup.cpp
gs/base/winrtsup.h
gs/ghostscript_rt.vcxproj
gs/psi/iapi.c
gs/psi/msvc.mak
main/pcl6_msvc.mak
winrt/GhostPDL.sln


2013-05-07 15:34:00 +0100
Chris Liddell <chris.liddell@artifex.com>
19dc7b855696c15a074067e883a13588aca8774d

Bug 691555: two jbig2dec patches for libpng14 Cygwin/MinGW

from yselkowitz@users.sourceforge.net

Adding "-lpng -lz" to LIBS causes everything to be linked against them,
whether or not they need them. Only the jbig2dec executable uses
libpng; libjbig2dec does not, so this causes a needless dependency on
libpng and zlib. Instead, define a separate PNG_LIBS variable and use
it in jpeg2dec_LDADD.

libtool requires the -no-undefined flag on PE platforms (Cygwin/MinGW)
in order to make a shared library due to the unique requirements of
DLLs.

No cluster differences.

gs/jbig2dec/Makefile.am
gs/jbig2dec/configure.ac


2013-05-07 15:11:10 +0100
Ken Sharp <ken.sharp@artifex.com>
cfa7da5e8b995023ab56186de1fe1e007619b63f

vector device - ensure colour changes are not restored away by clip

Bug #693951 "pswrite/epswrite is changing colors when creating an eps or an ps file from a ps file"

When an image is degenerated into trapezoids, then when writing the trapezoids
we first set the colour, then ensure any clip path is satisfied, then emit
the trapezoid and fill it.

However, if a clip path *is* pending, then it will emit a 'grestore' which
restores away the colour we initially set. This commit ensures that if a
clip is pending, we set the colour again after completing the clip.

No differences expected.

gs/base/gdevvec.c


2013-05-07 11:56:16 +0100
Chris Liddell <chris.liddell@artifex.com>
8128a2c74d319c430a76cca5620a6f4a77505e46

Bug 693253: have the "-h" output mention fontconfig

When Ghostscript is built to use fontconfig to try to find font files (in
addition to the "normal" paths), include a note in the "-h" output
that states fontconfig may be used.

No cluster differences.

gs/psi/imainarg.c


2013-04-15 18:35:36 +0100
Chris Liddell <chris.liddell@artifex.com>
e64ac4c83a4ae07dc15c4cacd7b60cba6294899a

Bug 693843: Add a gs_sprintf() function, and supporting code

Same as sprintf() but certain to be unaffected by localization.

Utilizes the "trio" string library, also added here. There is one modification
to trio, in trio.c and labelled with "/* GS Modification */" - by default, trio
is a little aggressive in the point it switches to exponent notation, and the
patch brings is more line with what we need/expect.

trio also includes a sscanf() function which we can utilise if required.

See the gs-sprintf branch for the individual commits - especially those in the
trio source, should a trio update ever be pulled in.

This causes rounding differences in the pdfwrite/ps2write output in a number
of the cluster files. They all appear to be pixel variations.

common/msvc_top.mak
common/ugcc_top.mak
gs/Makefile.in
gs/base/fapiufst.c
gs/base/gdevdevn.c
gs/base/gdevp14.c
gs/base/gp_macio.c
gs/base/gp_mswin.c
gs/base/gp_wgetv.c
gs/base/gs.mak
gs/base/gsalloc.c
gs/base/gsdevice.c
gs/base/gsdparam.c
gs/base/gsfcmap.c
gs/base/gsicc_create.c
gs/base/gsicc_manage.c
gs/base/gsiodisk.c
gs/base/gspmdrv.c
gs/base/gssprintf.c
gs/base/gssprintf.h
gs/base/gxblend.c
gs/base/gxblend1.c
gs/base/gxclmem.c
gs/base/gxhintn.c
gs/base/gxpath.c
gs/base/gxpcmap.c
gs/base/lib.mak
gs/base/md5main.c
gs/base/mkromfs.c
gs/base/sdcparam.c
gs/base/sjbig2.c
gs/base/spprint.c
gs/base/stdio_.h
gs/base/trio.mak
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/base/winlib.mak
gs/base/wrfont.c
gs/base/write_t1.c
gs/base/write_t2.c
gs/contrib/eplaser/gdevescv.c
gs/contrib/gdevcd8.c
gs/contrib/gdevdj9.c
gs/contrib/gdevhl12.c
gs/contrib/gdevxes.c
gs/contrib/gomni.c
gs/contrib/japanese/dviprlib.c
gs/contrib/japanese/gdevfmlbp.c
gs/contrib/japanese/gdevfmpr.c
gs/contrib/japanese/gdevj100.c
gs/contrib/japanese/gdevlbp3.c
gs/contrib/japanese/gdevmag.c
gs/contrib/japanese/gdevnpdl.c
gs/contrib/lips4/gdevl4r.c
gs/contrib/lips4/gdevl4v.c
gs/contrib/pcl3/src/gdevpcl3.c
gs/cups/gdevcups.c
gs/devices/gdev3b1.c
gs/devices/gdev8510.c
gs/devices/gdevccr.c
gs/devices/gdevdjet.c
gs/devices/gdevijs.c
gs/devices/gdevl31s.c
gs/devices/gdevpng.c
gs/devices/gdevsppr.c
gs/devices/gdevsun.c
gs/devices/gdevtifs.c
gs/devices/gdevtsep.c
gs/devices/gdevupd.c
gs/devices/gdevwpr2.c
gs/devices/gdevxini.c
gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.c
gs/devices/vector/gdevpdfe.c
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfi.c
gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfo.c
gs/devices/vector/gdevpdfr.c
gs/devices/vector/gdevpdft.c
gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpdfv.c
gs/devices/vector/gdevpdtb.c
gs/devices/vector/gdevpdtc.c
gs/devices/vector/gdevpdtf.c
gs/devices/vector/gdevpdti.c
gs/devices/vector/gdevpdtt.c
gs/devices/vector/gdevpdtw.c
gs/devices/vector/gdevps.c
gs/devices/vector/gdevpsf1.c
gs/devices/vector/gdevpsf2.c
gs/devices/vector/gdevsvg.c
gs/devices/vector/gdevtxtw.c
gs/devices/vector/gdevxps.c
gs/psi/dmmain.c
gs/psi/dpmain.c
gs/psi/dscparse.c
gs/psi/dwimg.c
gs/psi/dwmainc.c
gs/psi/dxmain.c
gs/psi/int.mak
gs/psi/iparam.c
gs/psi/iutil.c
gs/psi/iutil2.c
gs/psi/msvc.mak
gs/psi/zbfont.c
gs/psi/zdouble.c
gs/psi/zfapi.c
gs/psi/zfont2.c
gs/trio/CHANGES
gs/trio/FILES
gs/trio/Makefile.in
gs/trio/README
gs/trio/autogen.sh
gs/trio/compare.c
gs/trio/configure.in
gs/trio/doc/doc.h
gs/trio/doc/doc_dynamic.h
gs/trio/doc/doc_printf.h
gs/trio/doc/doc_register.h
gs/trio/doc/doc_scanf.h
gs/trio/doc/doc_static.h
gs/trio/doc/footer.html
gs/trio/doc/header.html
gs/trio/doc/trio.cfg
gs/trio/doc/trio.css
gs/trio/example.c
gs/trio/html/group___dynamic_strings.html
gs/trio/html/group___printf.html
gs/trio/html/group___scanf.html
gs/trio/html/group___special_quantities.html
gs/trio/html/group___static_strings.html
gs/trio/html/group___user_defined.html
gs/trio/html/index.html
gs/trio/html/modules.html
gs/trio/html/trio.css
gs/trio/install-sh
gs/trio/maketgz
gs/trio/regression.c
gs/trio/strio.h
gs/trio/trio.c
gs/trio/trio.h
gs/trio/triodef.h
gs/trio/trionan.c
gs/trio/trionan.h
gs/trio/triop.h
gs/trio/triostr.c
gs/trio/triostr.h
main/pcl6_gcc.mak
main/pcl6_msvc.mak
pcl/pcfontpg.c
pcl/pcht.c
pcl/pcstatus.c
pl/dwimg.c
pl/dwmainc.c
pl/pjparse.c
pl/plmain.c
pxl/pxerrors.c
pxl/pxfont.c
pxl/pxpthr.c
svg/svg_msvc.mak
xps/xps_msvc.mak
xps/xpsttf.c
xps/xpszip.c


2013-05-07 08:24:06 +0100
Ken Sharp <ken.sharp@artifex.com>
07ba8bea8e98084a156edac611a4ae92545edf06

fix commit 2adc88900956d92433e1d97ca3a22170a462f098

Seems there was a typo in this commit, which is fixed here.

gs/base/gxclread.c


2013-05-07 08:18:12 +0100
Ken Sharp <ken.sharp@artifex.com>
50533c139389cdfa7c652eb60b973239033aebc3

pdfwrite - get rid of some compiler warnings

gs/devices/vector/gdevpdtb.c


2013-05-02 17:03:57 -0700
Ray Johnston <ray.johnston@artifex.com>
2adc88900956d92433e1d97ca3a22170a462f098

Finish GrayDetection implementation and add pnmcmyk example device.

The pnmcmyk device will output a P5 pgm file if the page source colors
are all (near) neutral, otherwise will output PAM P7 32-bit CMYK.
This device is intended to be an example for a customer.

Note that there is a conditional compile based on PESSIMISTIC_CMYK_NEUTRAL
that, if defined, will assume that if any C, M, or Y component has a value
greater than DEVICE_NEUTRAL the page will be treated as color (even if all
three components are 100%). This may be what the customer requested.
The default comparison is based on the C, M, and Y components be close to
each other (similar to RGB).

Also disable graydetection during clist playback. We don't need worry about
page mode because colors are already processed as the image is rendered
into the page buffer, but high level images in the clist would slow down
if graydetection was performed again.

gs/base/gsicc_monitorcm.c
gs/base/gxclread.c
gs/devices/devs.mak
gs/devices/gdevpbm.c
gs/psi/msvc.mak


2013-05-06 17:03:10 +0100
Ken Sharp <ken.sharp@artifex.com>
b04bd6b0bb5098b809b3d06f69e2eb55905af648

pdfwrite - DO not leave dangling references in font/matrix cache

Bug #693948 "%d not working with pcl"

Under some conditions (TrueType fonts, but not CID TT), we end up adding the
font to the font/matrix cache. However, the font we add is a copy of the
original.

If we are using %d to emit multiple files, then we free our copies after
every page. However, we did not purge the cache, leading to stale pointers
in it. If we then reused a font we could end up trying to use a stale
pointer with unfortunate results.

This commit adds a 'notify' procedure so that we clear copied fonts from
the cache when they are released.

This caused one difference in the regression tests, which I do not understand
but is not visilby different....

Signed-off-by: Ken Sharp <ken.sharp@artifex.com>

gs/devices/vector/gdevpdtb.c


2013-05-06 07:47:00 -0600
Henry Stiles <henry.stiles@artifex.com>
0a3d34cfec18ffd3ae1c6fd29dc3c6d4755fe5a3

Fix font state variables not propely initialized and add character
angle state in PXL Pass Thru mode.

We note several progression in T427.BIN and C705.BIN with the change.

pxl/pxpthr.c


2013-04-29 09:40:19 -0700
Ray Johnston <ray.johnston@artifex.com>
73957305ae44e43174cd8173b94c35f9f4ca55b4

Add gdev_prn_bg_output_page (and _seekable) to support BGPrint.

Some devices are not compatible with background printing, if they are
not thread safe (use globals) or update the device structure.
Simple updates to the device structure can be handled in a device's
own output_page function that performs any actions needed before
calling gdev_prn_bg_output_page, then performing any action needed
after the page is printed (or started in the background). The cups
device is an example of this.

If the page is printed in the background, it uses a clone of the device
structure, so any changes to that structure will not be reflected in
the foreground device.

The devices were reviewed and those that were changed to use gdev_prn_bg
output_page proc should be safe for background printing, but only
those that are used in regression testing have been tested by forcing
BGPrint=true.

gs/base/gdevprn.c
gs/base/gdevprn.h
gs/cups/gdevcups.c
gs/devices/devs.mak
gs/devices/gdev3852.c
gs/devices/gdev4081.c
gs/devices/gdev4693.c
gs/devices/gdev8510.c
gs/devices/gdevadmp.c
gs/devices/gdevatx.c
gs/devices/gdevbit.c
gs/devices/gdevbj10.c
gs/devices/gdevbmp.c
gs/devices/gdevccr.c
gs/devices/gdevcdj.c
gs/devices/gdevcfax.c
gs/devices/gdevcif.c
gs/devices/gdevclj.c
gs/devices/gdevcljc.c
gs/devices/gdevcslw.c
gs/devices/gdevdfax.c
gs/devices/gdevdjet.c
gs/devices/gdevdjtc.c
gs/devices/gdevdm24.c
gs/devices/gdevepsc.c
gs/devices/gdevepsn.c
gs/devices/gdevescp.c
gs/devices/gdevfax.c
gs/devices/gdevhl7x.c
gs/devices/gdevicov.c
gs/devices/gdevimgn.c
gs/devices/gdevjbig2.c
gs/devices/gdevjpeg.c
gs/devices/gdevjpx.c
gs/devices/gdevl31s.c
gs/devices/gdevlbp8.c
gs/devices/gdevlj56.c
gs/devices/gdevlp8k.c
gs/devices/gdevlxm.c
gs/devices/gdevmgr.c
gs/devices/gdevmiff.c
gs/devices/gdevn533.c
gs/devices/gdevo182.c
gs/devices/gdevokii.c
gs/devices/gdevpbm.c
gs/devices/gdevpcx.c
gs/devices/gdevperm.c
gs/devices/gdevphex.c
gs/devices/gdevpjet.c
gs/devices/gdevplan.c
gs/devices/gdevplib.c
gs/devices/gdevpng.c
gs/devices/gdevpsd.c
gs/devices/gdevpxut.c
gs/devices/gdevpxut.h
gs/devices/gdevrinkj.c
gs/devices/gdevsgi.c
gs/devices/gdevsj48.c
gs/devices/gdevsppr.c
gs/devices/gdevstc.c
gs/devices/gdevsunr.c
gs/devices/gdevtfax.c
gs/devices/gdevtfnx.c
gs/devices/gdevtknk.c
gs/devices/gdevtsep.c
gs/devices/gdevxcf.c
gs/devices/vector/gdevlj56.c
gs/devices/vector/gdevpxut.c
gs/devices/vector/gdevpxut.h


2013-04-10 20:24:02 -0700
Ray Johnston <ray.johnston@artifex.com>
c947a5c62b9eef2b2b2afcab986a5b7bbb8fc3ad

Add BGPrint prn device parameter to render clist pages while parsing.

This enhancement closes the clist files of the page, then starts a
printing thread (prn_print_page_in_background) to write out the page
and returns to allow parsing of the next page into a new set of clist
files while the 'bg printing' thread writes out the data, performing
compression and other conversion that the BGPrint=false mode performs
in the main (parsing) thread.

If NumRenderingThreads > 0, the band rendering will also be performed
for multiple bands in separate threads.

Thus, the parsing of pages after the first will potentially overlap
the rendering and writing of the previous page. No queue is maintained,
so the overlap is limited to the next page.

If bg_print.device is not NULL, then we have a page that was rendered
in the background that we may need to wait for before pprinting the next
page or exiting. After we call the prn_finish_bg_print, we may need to
re-open the printer in case it was closed (most commonly due to %d in
the fname).

When printing in foreground mode, the bg_print.device will be NULL.

Note, We can't use the icc_table created for the foreground since it may
be in GC'd memory (it must be created with the thread's allocator).

The equivalent_cmyk_colors are needed by the backgorund print device.
Add .EquivCMYKColors device parameter which is an array of 5 integers per
spot color. The first integer is 'valid' followed by the 'frac' C, M, Y
and K values. This allows the gs_putdeviceparams to have the spot color
information.

The foreground device was relying on the print_page procedure to free
the separation names from a page before starting the next page. Move
this to gdev_prn_output_page instead. Also since this is common, we
don't need it in gdevpsd and gdevtsep print_page functions.

Expected difference when BGPrint=true is 99-01-fixed.PS for all devices
due to adding the .EquivCMYKColors device parameter.

gs/base/gdevdevn.c
gs/base/gdevprn.c
gs/base/gdevprn.h
gs/base/gxclist.h
gs/base/gxclpage.c
gs/base/gxclthrd.c
gs/base/gxclthrd.h
gs/base/lib.mak
gs/devices/gdevplib.c
gs/devices/gdevpsd.c
gs/devices/gdevtsep.c


2013-05-05 10:05:52 +0100
Ken Sharp <ken.sharp@artifex.com>
a5874589447b76a99eef2114acd12633beed7424

squelch a couple of minor compiler warnings

pcl/pcpatrn.c
pl/plchar.c


2013-05-04 09:13:12 +0100
Ken Sharp <ken.sharp@artifex.com>
e99c0e5b704954d61bfe5a26c410fdb01a3c48ae

Initialise a pointer to non-NULL to silence static analysis warning

The 'dereference of a non-NULL pointer' is incorrect, its not possible to
reach the questionable de-reference with the pointer NULL but it seems the
static analyser can't detect that. This should silence it.

gs/devices/vector/gdevpsdi.c


2013-05-04 09:11:32 +0100
Ken Sharp <ken.sharp@artifex.com>
601084bf86031eea15312c27718d13a7beda85a9

Include a prototype for gs_next)ids to silence a compiler warning

pcl/pcpalet.c


2013-05-03 10:37:50 +0100
Chris Liddell <chris.liddell@artifex.com>
a5a841b816c528b6f16a83ec02020db5953dde79

Update CFLAGS for debug build with gcc.

Add debug flags so that as many versions as possible of gcc will include the
macro expansion data in the debug build.

No cluster differences.

gs/configure.ac


2013-05-03 10:32:16 +0100
Chris Liddell <chris.liddell@artifex.com>
7db1a288da4d7838ec801e69f3e2f6bf46598aaa

Slightly de-macro-fy scfd.c

There were two macros used which were *way* too big for "good practice"
coding ("get_run" and "invert_data", and one changed for convenience
("skip_data").

Changing them to functions and testing shows a few seconds penalty for the
entire test suite - an acceptable trade, IMHO.

No cluster differences.

gs/base/scfd.c


2013-05-03 10:19:34 +0100
Chris Liddell <chris.liddell@artifex.com>
e7de6bf79a5702b79f1960af937955c7f6627e02

Bug 693940: remove deprecated call from gs/ijs/configure.ac

Thanks to James Cloos for pointing it out.

No cluster differences.

gs/ijs/configure.ac


2013-04-29 09:02:03 +0100
Ken Sharp <ken.sharp@artifex.com>
9cd48ce016f8ce490d32679dab5de3cd781f6f85

Add high level pattern support to PCL and HPGL

Unlike the PXL interpreter, but like XPS, the coding has been done in the
implementation routines rather than at the interpreter level. There are two
reasons for this; firstly the PCL interpreter already called gx_dev_set_color
and secondly the HPGL interpreter makes extensive use of macros which weren't
readily amenable to being altered in a way which would have allowed the
gs_error_Remap_Color error to be propogated upwards as required.

There are some differences with this commit, they are either very minor or
progressions (in my opinion).

gs/base/gsptype1.c
gs/base/gsptype1.h
pcl/pcdraw.c
pcl/pcpatrn.c
pcl/pctop.c
pcl/pgdraw.c
pl/plchar.c


2013-04-30 11:09:57 +0100
Ken Sharp <ken.sharp@artifex.com>
1c6f8a9297a2b16c22145a0328734ed137c02215

pdfwrite - handle Intellifonts as type 3 fonts

In order to deal with high level patterns used as the fill colour for an
Intellifont, we need to handle Intellifonts as type 3 fonts, just like
the stick font, and PCL bitmap fonts.

This results in numerous differences; in general text is bolder at
low resolution, the file 23-15.bin exposes a probable GS bug where the
glyphs are clipped at higher resolutions.

However, text can now be searched (also copy/paste), and the PDF files are
potentially smaller due to not having to emit each glyph description every
time it is used.

gs/devices/vector/gdevpdtd.c
gs/devices/vector/gdevpdte.c
gs/devices/vector/gdevpdtf.c
gs/devices/vector/gdevpdti.c
gs/devices/vector/gdevpdts.c
gs/devices/vector/gdevpdtt.c
gs/devices/vector/gdevpdtw.c


2013-05-02 09:56:04 +0100
Ken Sharp <ken.sharp@artifex.com>
437fd175241212c5dad1f045857956f12a588774

pdfwrite - fix some compiler warnings introduced with the palette colour fix

pxl/pxgstate.h
pxl/pxink.c
pxl/pxpaint.c
pxl/pxparse.c


2013-04-29 17:39:07 +0100
Ken Sharp <ken.sharp@artifex.com>
1c69af7f3e9830c39eb81961e90691e2ec847342

pdfwrite - fix buffer overrun in CIDToGIDMap

Bug #693854 "PDFA/2b conversion crashes often"

When converting TrueType fonts into CIDFOnts, because we are creating a PDF/A
output file, the calculated length of the CIDToGIDMap could be out by one
as the first CID is 0.

This later led to us writing beyond the end of the buffer, which could cause
real problems, depending on what was overwritten.

No differences expected.

gs/devices/vector/gdevpdtd.c


2013-04-29 16:18:57 +0100
Ken Sharp <ken.sharp@artifex.com>
6664f4554a5d63560f94ea99214a9ad289e8e925

Merge branch 'PCL_palette'


2013-04-26 12:57:40 +0100
Ken Sharp <ken.sharp@artifex.com>
7086f246fa047bcb9f3e9cfaacfbdae709058b91

Allow devices to inform the PCL interpreter that it must not alter palettes

Bug #692786 "Problem with HPGL paletted colour"

pdfwrite (and potentially other devices) can't cope with situations where the
interpreter alters the 'palette' (the lookup table in a /Indexed space) after
the space has been set to be the current color space.

However, if we unilaterally preserve the palette, it seems that this causes
performance problems (see bug #692786.

Here we add a new special op 'needs_invariant_palette' which allows a device
to communicate this. We alter the PCL interpreter to inquire the device's
requirements, and aler pdfwrite to communicate its needs.

This results in > 300 differences with pdfwrite, all of them progressions

gs/base/gdevdflt.c
gs/base/gxdevsop.h
gs/devices/vector/gdevpdfi.c
pcl/pcpalet.c


2013-04-29 13:01:42 +0100
Ken Sharp <ken.sharp@artifex.com>
e4ce3d9147ca6a4f2bdd9a0319b4b7d606492799

pdfwrite - add missing line from last commit

gs/devices/vector/gdevpsdi.c


2013-04-29 11:27:14 +0100
Ken Sharp <ken.sharp@artifex.com>
efdd46d415d7b117a6c5fcadd7c40facdd0db6af

pdfwrite - implement bicubic downsampling

Bug #693832 "Implement bicubic image downsampling in pdfwrite"
Bug #693917 "pdfwrite only downsamples by integer scales"

Adopting the patch from Math supplied in Bug #693832 resolves both
these problems. No cluster differences as the cluster doesn't test this
feature.

gs/devices/vector/gdevpsdi.c
gs/devices/vector/gdevpsds.c
gs/devices/vector/gdevpsds.h


2013-04-27 08:18:18 +0100
Chris Liddell <chris.liddell@artifex.com>
9fac58e19010c5f0772289052082d98f5d89e9a3

Use "seekable" rather than "positionable"

At Ray's suggestion, tweak the names from the previous commit.

No cluster differences.

gs/base/gdevprn.c
gs/base/gdevprn.h
gs/devices/gdevbmpa.c
gs/devices/gdevdfax.c
gs/devices/gdevsgi.c
gs/devices/gdevtfax.c
gs/devices/gdevtfnx.c
gs/devices/gdevtsep.c


2013-04-25 19:21:36 +0100
Chris Liddell <chris.liddell@artifex.com>
8bf1c216211d1bf036369fd731fafd1b30eff168

Have gdev_prn_open_printer_seekable() work sensibly

If gdev_prn_open_printer_seekable() gets called with the seekable flag set,
and it can't return a seekable file object, return an error, rather than
silently ignore the flag.

Add a generic gdev_prn_output_page_positionable() function to replace the one
that was dedicated to the TIFF devices, and update the TIFF devices and the
two other devices which require positionable output files to use it.

No cluster differences.

gs/base/gdevprn.c
gs/base/gdevprn.h
gs/devices/gdevdfax.c
gs/devices/gdevsgi.c
gs/devices/gdevtfax.c
gs/devices/gdevtfnx.c
gs/devices/gdevtifs.c
gs/devices/gdevtifs.h
gs/devices/gdevtsep.c


2013-04-25 12:01:31 +0100
Chris Liddell <chris.liddell@artifex.com>
46d3a7b65de05a0268ce969f8070064bc14913e5

Bug 693704: Use font name to determine italic-ness

Allow the font name analysis to override the Italic Flags field from the font
descriptor in determining if a font is italic or oblique.

This results it progressions (when compared to Acrobat, and several other PDF
readers) in these cluster files:

prfmm.pdf
CATX2445.pdf
fts_23_2308.pdf
1265_-_portable_collection.pdf
x_-_Times_New_Roman_wrongly_substituted_regression.pdf

gs/Resource/Init/pdf_font.ps


2013-04-25 07:48:11 +0100
Chris Liddell <chris.liddell@artifex.com>
239b3af18363a77785837af64842afe0bc433c67

Small doc updates.

State clearly that the TIFF devices must use a seekable file for output.

Update the description of CropBox - largely paraphrasing the PDFRM.

CLUSTER_UNTESTED

gs/doc/Devices.htm
gs/doc/Use.htm


2013-04-24 19:56:45 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
27a54e4b455c4295e5effc8bb6a392b6a44f118c

Bug 693933: Fix division by 0 in monotony check.

Monotony checking procedure caused division by 0 when the start and
the end points of the interval were the same. Any function on such a
domain is now considered monotonic.

gs/base/gsfunc3.c


2013-04-24 12:17:54 -0700
Ray Johnston <ray.johnston@artifex.com>
ce3ca09ca7e0b489187fc9788aaa795707f17ed1

Fix broken windows build due to missing #include "stat_.h"

gs/base/gp_mswin.c


2013-04-24 08:27:41 +0100
Chris Liddell <chris.liddell@artifex.com>
55bbe8836df1bb8e521a6fb4e79a91d7e0702fb1

Bug 693932 (related): generate meaningful error

Add a gp_fseekable() function, and use it to check the file object opened in
gdev_prn_open_printer_seekable(). If the file is not seekable, print an error
message and return an IOerror.

No cluster differences.

gs/base/gp.h
gs/base/gp_mswin.c
gs/base/gp_os2.c
gs/base/gp_unifs.c
gs/base/gp_vms.c
gs/devices/gdevtifs.c


2013-04-22 15:56:11 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e67086e1d63d449900570b30e2b2e1c91ed187a4

Initial commit of adding neutral color monitoring

This commit adds in the command line option -dGrayDetection=true/false. When set, the special CMM procedures
will be inserted to monitor the presence of non-neutral colors. When a non-neutral color is encountered
no additional monitoring will be preformed. Monitoring is done during the clist writing phase and as such
high level images are also monitored. CMYK Colors are consider non neutral if C=M=Y=0 (or very close). RGB
colors are considered neutral if R=G=B or very close and CIELAB colors are considered neutral if a=128 and b=128
or very close. A fuzzy range can be set for how close we need to be via defines in the code. The
current values were set based upon using images that were created to be monochrome in Photoshop using ICC
profiles. Testing for this was performed for a variety of image types. The remaining part of this project,
which relates to bug number 693583 is to do something useful with the presence of monochrome only data during
the clist playback phase. The values pageneutralcolor = true and graydetection, which are member variables in
cmm_dev_profile_t, during clist playback will indicate that the page is neutral. Note that the clist playback
device should set pageneutralcolor = false during the actual playback to avoid continued monitoring of
high level image data, which would occur as the data is pushed through the CMM. graydetection is the
device parameter and as such, pageneutralcolor only has meaning when graydetection = true.

gs/base/gdevp14.c
gs/base/gdevp14.h
gs/base/gscms.h
gs/base/gsdparam.c
gs/base/gsequivc.c
gs/base/gsicc_cache.c
gs/base/gsicc_cache.h
gs/base/gsicc_cms.h
gs/base/gsicc_lcms2.c
gs/base/gsicc_manage.c
gs/base/gsicc_monitorcm.c
gs/base/gsicc_nocm.c
gs/base/gsicc_replacecm.c
gs/base/gxclimag.c
gs/base/gximage.c
gs/base/gxiparam.h
gs/base/gxipixel.c
gs/base/lib.mak


2013-04-23 00:54:24 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
07abd0c0bbddef1eed84969e9d8b7ba5f548d0d9

Bug 687604: Reject out-of-bounds access to cvt table.

Revert the patch b550e8c460daa0647fd1f4ce63ae3c73edc75a5c because
it is not needed now, but it causes SEGV when cvt table is missing.

gs/base/ttinterp.c


2013-04-22 21:28:57 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
6f51cd7b9d5c2e5185eec30579238bb14863a5e5

Bug 693930: Accept and ignore null entries in the page tree.

gs/Resource/Init/pdf_main.ps


2013-04-21 19:20:12 -0600
Henry Stiles <henry.stiles@artifex.com>
11638a77454ace993bf106dab3cd7e182bf1e250

Fix 693836, valgrinds reports read of uninitialized value.

The loop accessed memory past the end of each source line. This did
not result in an error because we would exit the loop before the data
was used, but nonetheless it is an invalid read outside the memory
allocation so we rearrange the loop conditions to avoid it.

gs/base/gdevm24.c


2013-04-21 11:29:08 +0100
Chris Liddell <chris.liddell@artifex.com>
a63c1486c770a810a6cfa24ab397ee3c3c798816

Bug 687604: work around another broken TT font

Fallback to rendering unhinted if Freetype returns an Invalid_Reference error.

No cluster differences.

gs/base/fapi_ft.c


2013-04-19 17:29:04 +0100
Ken Sharp <ken.sharp@artifex.com>
5ec87a6d6971f059c4135af3fddd17b34f20c7ae

pdfwrite - actually assign the structure members to 0

gs/devices/vector/gdevpdte.c


2013-04-19 14:41:21 +0100
Ken Sharp <ken.sharp@artifex.com>
9155d0f3ee7bb9ffc6cb63b21402b5219c7335f2

pdfwrite - initialise some structure members to pacify valgrind

pdf_glyph_widths already sets these to zero, so we only need to bother if
we aren't using pdf_glyph_widths.

No differences expected.

gs/devices/vector/gdevpdte.c


2013-04-19 09:35:18 +0100
Chris Liddell <chris.liddell@artifex.com>
0d3f3ab6ceeaf2b95f9318845bce770cf44efad7

Bug 693925: Add some checking for ufst configure option

The two configure scripts now check for the existence of the specified UFST
directory, and for the existence of fapiufst.mak in that directory.

No cluster differences.

configure.ac
gs/configure.ac


2013-04-19 10:03:45 +0100
Ken Sharp <ken.sharp@artifex.com>
7e62f84b93a517ac43ebb5d26912a0786b37916e

pdfwrite - fix transparency preservation with PDF/A-2

An oversight with the introduction of PDF/A-2 could lead to transparency
not being preserved, because we tested only the request for PDF/A without
checking the level required.

No Differences expected, not tested by the cluster.

gs/devices/vector/gdevpdft.c


2013-04-19 00:13:18 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
4b0ccdcd37d8bf5924bd9572994535c5a1b20169

Bug 693869: work around errors in dash offset calculation

Make sure that the offsed doesn't exceed the total length of
the dash pattern. Fix out-of-bounds access and a corresponding
Valgrind warning.

gs/base/gsline.c


2013-04-18 11:04:49 -0600
Henry Stiles <henry.stiles@artifex.com>
52d113e470047ea70485de785bc9a3b68731127c

Fix typo in SVG output device (bug #693922) by Shailesh Mistry.

gs/devices/vector/gdevsvg.c


2013-04-18 09:06:08 +0100
Ken Sharp <ken.sharp@artifex.com>
f521500bdc2d39ad5f2caf91b3630a1370a08a5f

Add high level pattern support to the PXL interpreter

Also, fix a possible Seg fault in pdfwrite, which was uncovered by this
work.

As might be expected this commit does introduce a fairly large number of
differences in the regression tests. I've looked at them all and I'm happy
that they are minor differences rather than faults.

gs/devices/vector/gdevpdfb.c
pxl/pxfont.c
pxl/pxgstate.c
pxl/pximage.c
pxl/pxink.c
pxl/pxl.mak
pxl/pxpaint.c
pxl/pxparse.c


2013-04-18 08:34:41 +0100
Chris Liddell <chris.liddell@artifex.com>
23e6bd304db08011b67b7f45dfcf23885fc0c8a3

Bug 693921: "refresh" pointer when rendering glyph

Before we call into the gs_fapi_do_char(), refresh the context pointer in the
FAPI server data - in case the context has been moved by a GC since the font
was created.

No cluster differences.

gs/psi/zfapi.c


2013-04-17 17:46:16 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
ece14831a4301dd0291184e1f27729b73d6f350b

Bug 693919: Replace malformed numbers with 0.

Scan BBox elements and replace non-numbers with 0. Our PDF tokenizer
usually assumes that malformed numerals are names.

gs/Resource/Init/pdf_main.ps


2013-04-17 14:30:10 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
d9a327b4e24043fb153996fdd18a367483d13521

Bug 693920: Add missing dereference of an indirect object.

gs/Resource/Init/pdf_draw.ps


2013-04-17 12:29:11 +0100
Chris Liddell <chris.liddell@artifex.com>
4dfe603dc49aeee09457ea7a0734d7484e0467ea

Add tiff-config directory to .gitignore.

CLUSTER_UNTESTED

.gitignore


2013-04-15 19:10:25 +0100
Chris Liddell <chris.liddell@artifex.com>
b1254130df0da4c311e9761b5784a12c6dad1dc9

Have tiff configure run in separate directory.

Run libtiff's configure script in a separate directory to prevent poluting
libtiff's source directory.

the Ghostscript distclean target has been revised to remove the tiff config
directory, and the ghostpdl makefile has new distclean and maintainer-clean
targets.

No cluster differences.

Makefile
common/msvc_top.mak
configure.ac
gs/Makefile.in
gs/base/gs.mak
gs/base/lcupsi.mak
gs/base/tiff.mak
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/configure.ac
gs/psi/msvc.mak
gs/toolbin/localcluster/clusterpush.pl
main/pcl6_gcc.mak
main/pcl6_msvc.mak
svg/svg_msvc.mak
xps/xps_msvc.mak


2013-04-17 09:23:19 +0100
Chris Liddell <chris.liddell@artifex.com>
1c006433024cb996022db86a7e7ec59f103e8efb

Remove the deprecated macos-fw.mak

CLUSTER_UNTESTED

gs/base/macos-fw.mak
gs/doc/Develop.htm


2013-04-17 09:24:22 +0100
Chris Liddell <chris.liddell@artifex.com>
28acb04f77ba58b1507c32d52402e2ff8eaa2e40

Raise the default VMThreshold from 1Mb to 8Mb

This seems like a fair change based on modern hardware and, in particular
modern PDF files. In some cases this results in a significant speed
improvement. It may increase overall memory usage, but testing suggests only
by an insignificant amount in the vast majority of cases.

No cluster differences.

gs/psi/zvmem2.c


2013-04-15 09:38:56 +0100
Chris Liddell <chris.liddell@artifex.com>
407cc61e87b0fd9d44d72ca740af7d3c85dee78d

"starting_arg_file" should only apply once.

The "starting_arg_file == true" setting should apply to the *first* call to
lib_file_open() in the context of a given call to runarg(). Previously, it
remained set for the entire duration of the runarg() call, resulting in the
current directory being searched for any resource files required by the job.

We also want "starting_arg_file == false" when runarg() is called to execute
Postscript from a buffer, rather than a file argument.

There is a very small chance this may cause problems with some strange scripts
or utilities, but I have been unable to prompt such an issue. If one does arise,
we may have rethink this entirely.

No cluster differences.

gs/psi/imainarg.c
gs/psi/zfile.c


2013-04-13 23:21:50 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
3648ad1d3d1f47df3e4a6e36ff5160e2bff25079

Remove spurious address-of operator.

gs/base/gscscie.c


2013-04-13 01:36:44 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
ed31bf693b457ecd13cfa4fc67f12288241448ce

Bug 691389: Pacify Valgrind; zero image flip buffer.

When the image has less than 8 scanlines, flipping includes the wild
end of the buffer and causes warnings in memflip8x8().

gs/base/gxifast.c


2013-04-10 20:13:05 +0100
Robin Watts <robin.watts@artifex.com>
cd414f3582ef95a3b0fd941e62370053126cba5c

Avoid potential out of bounds memory accesses

In image_render_mono we have code that skips forwards multiple
pixels at a time without checking for hitting the end of the
buffer. Fix that here.

gs/base/gximono.c


2013-03-24 11:23:01 +0000
Chris Liddell <chris.liddell@artifex.com>
ecc7a199e9307475c37fea0c44d24b85df814ead

Bug 693488: Improved glyph name aliasing.

Implement a more flexible approach to glyph name aliasing which handles all the
names in the Adobe Glyph List.

Thanks to John Wehle ( john@feith.com ) for this implementation.

For the time being, you can use "-dUSEOLDGLYPHALIASING" to revert to the old
code - assuming all goes well, that option will be removed for the release
following 9.09.

No cluster differences.

gs/Resource/Init/gs_ttf.ps
gs/Resource/Init/gs_type1.ps


2013-04-11 17:22:11 +0100
Ken Sharp <ken.sharp@artifex.com>
4c27c7d63acbf4500eab8d056541535ed5010b5c

ps2write - do not emit CIEBased spaces as ICCBased for PostScript

This was an oversight when I was trying to preserve CIEBased colour spaces,
it turns out that its not possible to preserve them, and I accidentally left
the code emitting them as ICCBased, which doesn't work in PostScript.

We now fall back to the old approach, in future we hope to use LCMS2 to
create a CIEBased space from the ICCBased profile for us.

No differences expected, code not enabled by default

gs/devices/vector/gdevpdfc.c


2013-04-02 12:26:09 +0100
Chris Liddell <chris.liddell@artifex.com>
9ff3e23fcf1c73e83e4bbb797b9033c7a25bf255

Bug 693804: (valgrind) initialize gs_fapi_raster

It's easiest to set the entire struct to zeros, since we need to initalize
nearly the entire structure anyway, before passing to the scaler/renderer.

No cluster differences

gs/base/gxfapi.c


2013-04-02 17:23:24 +0100
Chris Liddell <chris.liddell@artifex.com>
55c01c51ac53d244affde7b683f1f4cff24bcc46

Bug 693785: (valgrind) make gx_hld_saved_color_equal() do explicit checks

gx_hld_saved_color_equal() originally did a simple memcmp(), but due to padding
and GC considerations, that isn't reliable, so it needs to compare the contents
of the structure explicitly.

This does cause some differences in the PCL cluster tests with pdfwrite.

gs/base/gxhldevc.c
gs/base/lib.mak


2013-04-03 16:42:24 +0100
Chris Liddell <chris.liddell@artifex.com>
312d3c7655e2484e27160478e3120796cf9bbe10

Bug 693736: (valgrind) rejig a call to a function pointer

This is just a rejig to a functionally equivalent form that valgrind seems happier with.

It makes no real difference, but reduces the valgrind "noise" at no expense.

No cluster differences.

gs/psi/igc.c


2013-04-10 16:11:05 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
d73d2d365efc7331bf1dbfe70e427e8ead829778

Bug 693738: Trap bit run search

Fix a valgrind warning. Create a termination zone filled with
alternating bit pattern to guarantee that a search for a bit run
ends within the termination zone.

gs/base/scfd.c


2013-04-08 22:42:24 -0700
Ray Johnston <ray.johnston@artifex.com>
a3225b70cb1b92ca0f657d99b3bc496e6046fc39

Fix valgrind issue, bug 693735. image_render_mono condition using UMR.

The psrc scanning loop did not stop at the end of the data in some
cases. Since data past the image would tend to be variable, this
would usually stop scanning fairly soon and the 'fit_' macro logic
in fill/copy routines would make sure to limit the painting to a
valid area. Strange that this didn't show up in image artifacts.

gs/base/gximono.c


2013-04-10 00:56:15 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
897c36aa8cd754448bab5b712e48d46e2b117478

Bug 693798: Fix buffer overrun.

When jbig2dec detects that a run of pixels exceeds the image width,
it clamps the beginning and end of the run to the image width+1.
Probably, this is done to make runs that are entirely outside of the
image to leave no marks. This patch adds 1 byte to the image
buffer to ensure that writing 1 byte beyond the image line is valid.

gs/jbig2dec/jbig2_image.c


2013-04-09 15:15:00 +0100
Ken Sharp <ken.sharp@artifex.com>
5f5524b1f2ab76aff70b2b4a896b9474bdfb9501

pdfwrite - prevent rounding errors in TrueType widths

See Bug #693825

Rounding errors converting TrueType widths into PostScript/PDF led to us
emitting lots of tiny glyph movements. These were visually imperceptible
but led to larger than necessary output, because of all the tiny shifts.

This commit fixes the widths from TrueType fonts to the nearest integer
which makes it much more likely they will match the entries in the /W or
/Widths arrays, and thus not result in tiny movements.

The file in Bug #698325 is 5% smaller with this change, and the output PDF
file does actually match the original more closely (when using a high zoom
factor and careful inspection)

This does (unsurprisingly) cause a lot of differences in the test suite,
but I've looked at all of them and can see no definite problems. The
differences are pretty much single pixel shifts and this can sometimes
cause low resolution output to be slightly better, or slightly worse.

gs/devices/vector/gdevpdte.c


2013-04-09 08:33:01 +0100
Ken Sharp <ken.sharp@artifex.com>
f7567c53867f01e9dd33a1f882bb489dc765b869

pdfwrite - correct tracking of current point with word spcaing

Bug #693285 "gs adds spaces and breaks formatting of original pdf file"

This one is quite subtle and caused by a number of interacting issues.

Firstly the design grid conversion of TrueType fonts can lead to TT CIDFonts
ending up with very slightly different widths from the font to the widths in
the /W array (rounding errors). When emitting text we then use the TJ operator
and emit tiny movements for each glyph.

The second part then, is the limit we have of 50 movements per TJ operation.
There's no indication why we have this limit but I assume its some ancient
version of Acrobat. When we get to 50 moves we close the current line of text
and begin a new one.

The third part is that, in order to start the new line from the correct x offset
(so it lines up properly with the previous line), we keep a running track of
the current position and use that to tell us where to start the new line.
This value was getting the word spacing value applied to it whenever the
current character was a space (0x20). However, we only apply the word spacing
to *single* byte encodings in PDF (unlike PostScript) and the font in this
particular file doesn't have a single byte range.

To fix this we need to know if the text came from a (a)widthshow operation
from PDF, or from PostScript. Fortunately the text enumerator already has
a 'single_byte_space' member which tells us this. If it was from PDF we then
need to check if the character encoded used 1 byte or more than one, and
not apply the word spacing if it used more than 1. To this end we now pass
in the number of bytes to process_text_modify_width.

This change exhibits progressions in fts_20_2001.pdf and fts_22_2202.pdf

gs/devices/vector/gdevpdtc.c
gs/devices/vector/gdevpdte.c
gs/devices/vector/gdevpdtt.h


2013-04-09 09:12:01 +0100
Chris Liddell <chris.liddell@artifex.com>
496d8d3b8ea3d560dc260b1d03d9ed45b38e6960

Bug 693842: Fix a typo in gp_vms.c

There was a "=" instead of "==" mistake in the file name validation code.

Thanks to jond666@hotmail.com for pointing it out.

CLUSTER_UNTESTED

gs/base/gp_vms.c


2013-04-09 09:05:59 +0100
Chris Liddell <chris.liddell@artifex.com>
17bc8825debb794fc83f832b96da1ef9eead6aa4

Bug 693846: Fix configure inclusion of gdevjbig2.dev

There was an error in the configure so that we ended up using "jbig2.dev" in
both the FEATURE_DEVS and DEVICE_DEVS lists.

It now, correctly, uses gdevjbig2.dev in the DEVICE_DEVS list.

No cluster differences.

gs/configure.ac


2013-04-05 12:24:34 -0600
Henry Stiles <henry.stiles@artifex.com>
a4ae7c831da7e113665ae53e02b215c62bc3dbbd

Fix 693841, the symbol set parameter could be read uninitialized.

pxl/pxfont.c


2013-04-05 09:52:35 -0600
Henry Stiles <henry.stiles@artifex.com>
002551b7baa1e6e0a10670672d34870c3e229925

Read the old page size from the device, not from PCL's state.

The current paper selecting design could already have the new
requested page size in PCL's state at this point in the code; it was
possible to miss selecting a new paper size even though there was a
paper size change.

pcl/pcpage.c


2013-04-05 09:48:36 -0600
Henry Stiles <henry.stiles@artifex.com>
c77af98a0ff3d54ce52fb043149cef0a1b83e311

More lenient interpretation of the PJL language variable.

Accept any language variable string that contains the substring "GL"
to indicate the job should be processed in RTL/HPGL-2 mode.

pcl/pctop.c


2013-04-05 09:46:03 -0600
Henry Stiles <henry.stiles@artifex.com>
2892a755b3cc1e56f859046154f249afde1dcca0

Initialize PCL completely before XL Passthrough.

pxl/pxpthr.c


2013-04-02 17:12:04 -0600
Henry Stiles <henry.stiles@artifex.com>
86c33715ecf80e58ae4bde341820a6c76b23c288

Fix memory corruption problem with HPGL/2 page sizes.

Setting a page size in the HPGL/2 code depended on memory in a local
stack frame. This problem was introduced when custom page size
support was added to PCL which resulted in reorganizing the paper type
set up. Unfortunately HPGL/2 - RTL mode was not updated to use the
new paper setup when the PCL change was made.

pcl/pcpage.c
pcl/pcpage.h
pcl/pgconfig.c


2013-04-04 15:47:47 +0100
Robin Watts <Robin.Watts@artifex.com>
87b4d9c7abb36040079e099600cd31a5917be31d

Remove unneeded tests from ENABLE_VALGRIND macros.

Now gs_alloc_fill is called correctly, I can back out these extra
tests.

gs/base/gsmdebug.h


2013-04-04 15:17:03 +0100
Chris Liddell <chris.liddell@artifex.com>
673511c63137ff5cf5dddcacd7ff5f1cc9f42fd3

Correct a mistake in the memory alloc header code.

In the -Z@ case, I had left offsets in place for filling freed memory in
i_resize_string() which could cause gs_alloc_fill() to be called with a
negative length.

No cluster differences.

gs/base/gsalloc.c


2013-04-04 01:12:45 +0100
Robin Watts <Robin.Watts@artifex.com>
773c42ffc7e1e96c0bd99c7f577090c8b0684577

Fix ENABLE_VALGRIND problems.

gs_alloc_fill was having a bad interaction with
VALGRIND_MAKE_MEM_UNDEFINED in corner cases.

gs/base/gsmdebug.h


2013-04-02 14:45:20 +0100
Robin Watts <robin.watts@artifex.com>
2e9a498db41d0d601ab736687d332b2ab3de2a54

Add valgrind.h dependencies to lib.mak to avoid warnings.

gs/base/lib.mak


2013-03-28 07:53:23 +0000
Chris Liddell <chris.liddell@artifex.com>
5403b7384b203c6b462f8ed3190b7962c929769c

Add an ID to memory allocations.

This is to aid following objects through GC.

This is fairly straight forward with gs_struct_.... type allocations where
there is a memory manager header structure associated with the allocation,
so the ID is added to that.

But so called "string" allocations (i_alloc_string() and co) are more tricky
because these have no header, so these have the ID "tacked on" at the beginning
of the memory allocation. This means that the memory manager and the garbage
collector need to "just know" that the extra bytes exist.

The assigning and incrementing of the ID variable (normally) on happen in a
debug build. The ID variable itself can be left out by adding:
-DGS_USE_MEMORY_HEADER_ID=0

(or equivalent) to the compiler command line.

Finally, in a debug build, there is a get_mem_hdr_id() convenience function
you can call from a debugger - it takes a pointer to block of memory, and
returns the ID assigned to the allocation. Obviously, if the function is called
on memory automatically allocaed on the stack, it will probably cause bad
things to happen.

No cluster differences.

gs/base/gsalloc.c
gs/base/gxobj.h
gs/psi/igcstr.c


2013-04-02 03:47:24 -0700
Robin Watts <robin@peeves.(none)>
693c516ad22bb79d7c8c85329ff6a53dc82505fc

Memento: Improve interaction with valgrind.

Ensure that blocks headers are correctly marked accessible/
unaccessible.

gs/base/memento.c


2013-04-02 11:14:41 +0100
Ken Sharp <ken.sharp@artifex.com>
b0264dc9764935e548042597ca5d3c08bc513d31

pdfwrite - initialise a return code

Spotted by scan-build, the return code is uninitialised when both stream
and dictionary have previously been hashed. This would not normally cause a
problem, but its best to be safe.

No differences expected.

gs/devices/vector/gdevpdfo.c


2013-04-01 16:57:37 -0700
Robin Watts <robin@peeves.(none)>
9182dfdce82310e96fbb7b92759dcc913e0f6a2e

Update valgrind.h to include helgrind header too.

Cope with the version of helgrind being too old that it doesn't
provide the required macros and causes missing symbol errors.

gs/base/gsinit.c
gs/base/gxclfile.c
gs/base/gxclist.c
gs/base/gxclmem.c
gs/base/valgrind.h
gs/psi/imain.c


2013-04-01 10:32:28 -0700
Robin Watts <robin@peeves.(none)>
4e4883fdd27201e35b93e9fbdbe5d1f2380a030b

Memory squeezing: Unchecked error codes.

Fix unchecked error codes in gs_output_page.

gs/base/gsdevice.c


2013-04-01 09:51:40 -0700
Robin Watts <robin@peeves.(none)>
952405f72db6ba9f706e75f7cbf66193a575ec98

Bug 693824: Valgrind problems in interpolated images.

The first of the valgrind problems reported here is a false
positive; when scaling just a subsection of an image we
scale extra 'support' pixels. Due to the way this works we
end up scaling a few extra lines/columns around the rectangle
we actually need. Some of the input values to these extra
lines are not copied in, hence we see valgrind complaining
about uninitialised values.

We fix this with some PACIFY_VALGRIND code to memset the
input buffers to 0.

This commit also fixes valgrind errors seen later due to
us trying to color convert color values outside of the
active region; we fix this by restricting the area we
color convert. This will give speedups in some cases.

gs/base/gxiscale.c
gs/base/siscale.c


2013-04-01 08:31:11 -0600
Henry Stiles <henry.stiles@artifex.com>
07c3453ee6545e660fe1f7215b0ba5f540b7cd7b

Change ownership of JBIG2 to Alex.

CLUSTER_UNTESTED

doc/who_owns_what.txt


2013-04-01 06:20:14 -0700
Robin Watts <robin@peeves.(none)>
050745afeddbaf506ab4dd92661d583ba6e3eb06

Valgrind: Fix spurious warnings in gc

The Ghostscript object headers have a union of bitfields; these are
arranged so that they are all of the form 1 bit, then n-1 bits
(where n is a power of 2), so they pad nicely to a nice size.

Specifically they are designed to work like this (as far as I can
make out) to allow the 'alone' bit to be preserved during gcs
when the n-1 bit fields are used. Valgrind, I think, finds this
problematic.

The fix in this commit is simply to initialise both the alone bit
and the padding bits at the same time (any even halfway decent
compiler should combine these into a single byte write, so we
should actually find this new safer code is faster than the previous
single bit initing code). This is safe because the other unions
are only used during gc.

Cluster testing shows no differences, and local valgrind runs
appear cleaner.

gs/base/gsalloc.c
gs/base/gxobj.h
gs/psi/igcref.c
gs/psi/isave.c


2013-03-31 04:07:53 -0700
Robin Watts <robin@peeves.(none)>
b319291a7a57de7344122269ae56deb65121de60

Memory squeezing fix: zsave: Fix SEGV

When freeing saved spaces due to an allocation failure, unlink the
space from the linked list of saved ones to prevent gc SEGV later.

gs/psi/isave.c


2013-03-30 04:26:01 -0700
Robin Watts <robin@peeves.(none)>
fe31fceb7870b24bcf9c5b477f76943abacce75f

Memory Squeezing: crash in gc after zsave.

Ensure that the save structure is set up enough to be safely gc'd
on allocation.

gs/psi/isave.c
gs/psi/zvmem.c


2013-03-30 03:34:04 -0700
Robin Watts <robin@peeves.(none)>
d88779e3579db3c9c134ec7c5ee54e7ab4579399

Memory Squeezing: gsicc_manage.c: Check for allocation failures

In faviour places we allocate pname, and then use it without
checking. Simply add checks.

gs/base/gsicc_manage.c


2013-03-30 09:26:53 +0000
Ken Sharp <ken.sharp@artifex.com>
97d4e9f31bb0f5d1f8feb97106fc5879bb9a4fcb

pdfwrite - ensure a variable is initialised

I can't see a way that this could cause the valgrind complaint in bug
#693813, but its the only variable in the offending line which is not
explicitly initialised. So initialise it here just in case.

No differences expected.

gs/devices/vector/gdevpdfc.c


2013-03-29 17:43:14 -0700
Robin Watts <robin@peeves.(none)>
f23d8aca44eee8ab1e289b350c968b074b8bec76

Memory Squeezing: JPEG compression; avoid double free.

The JPEG compression stream state calls gs_jpeg_destroy, but this may be
called earlier. If this does get called earlier, ensure that we leave the
stream in a state where it won't access freed memory.

gs/devices/vector/gdevpsdu.c


2013-03-29 14:16:38 -0600
Henry Stiles <henry.stiles@artifex.com>
852e5451e741515551edd55916a3cf49a5a2540e

Fix bug 693576 - bad pxl file generated.

It was possible for the XL driver to produce XL drawing commands
without setting the color space in advance. Thanks to Hin-Tak Leung
for the fix.

gs/devices/vector/gdevpx.c


2013-03-29 11:46:35 -0700
Robin Watts <robin@peeves.(none)>
00ccf0ce1304f3f6a9493138f2fb0cb00f3326f9

Memory squeezing: JPEG encoding stream release

When destroying a JPEG encoding stream, we assume that the setup got
far enough to have allocated a jmpbuf and a compression struct. Add
some checks so we cope if this is not the case.

gs/base/sdcte.c
gs/base/sjpegc.c


2013-03-29 11:14:29 -0700
Robin Watts <robin@peeves.(none)>
a68c6641b8b576c88c497d8089b17bc7ec32d383

Memory squeezing: LCMS2: BuildGrayInputMatrixPipeline leak

Avoid leak in allocation failure case.

gs/lcms2/src/cmsio1.c


2013-03-29 09:31:07 -0700
Robin Watts <robin@peeves.(none)>
31f437e09d443e1f1ae78f4f909728b45d550695

Memory Squeezing: LCMS2: CLUTElemDup

Check for allocation failures and tidy up if found.

gs/lcms2/src/cmslut.c


2013-03-29 10:01:18 -0600
Henry Stiles <henry.stiles@artifex.com>
ebf32c26d8224ab7c81766c0d516986fd1ce4027

Fix more gnu indent unwanted side effects.

We still have a bit more to do but this fixes the most egregious
problems.

pcl/pccsbase.c
pcl/pcht.c
pcl/pcstatus.c
pcl/pcsymbol.c
pcl/pcsymbol.h
pcl/pctext.c
pcl/pctop.c
pcl/pgchar.c
pcl/pgcolor.c
pcl/pgconfig.c
pcl/pgframe.c
pcl/pggeom.c
pcl/pglabel.c
pcl/pglfill.c
pcl/pgparse.c
pcl/pgpoly.c
pcl/pgvector.c
pcl/rtmisc.c
pcl/rtrstcmp.c
pl/pjparse.c
pl/pjparsei.c
pl/plftable.h
pl/plmain.c
pl/plplatfps.c
pl/pltop.c
pxl/pxerrors.c
pxl/pxfont.c
pxl/pxgstate.c
pxl/pxparse.c
pxl/pxptable.c
pxl/pxsessio.c
pxl/pxstate.c


2013-03-29 08:29:31 -0700
Robin Watts <robin@peeves.(none)>
0250740ec53e8df3f2fcfd96a725574996256524

Memory squeezing fix: LCMS2: avoid AllocateToneCurveStruct returning partial built struct.

Simply add an extra check on the last allocation.

gs/lcms2/src/cmsgamma.c


2013-03-29 08:22:34 -0700
Robin Watts <robin@peeves.(none)>
321c5a324977410d7fac84be174453460a3210a9

Memory squeezing: More LCMS2 fixes.

Fix some broken error code, add some checking where it was missing, and
fix a potential leak.

gs/lcms2/src/cmscnvrt.c
gs/lcms2/src/cmslut.c


2013-03-29 12:43:33 +0000
Robin Watts <robin.watts@artifex.com>
44f807320c741d07a38bc565752160ecb8c6f71b

Memory squeezing fix: lcms2 cmsPipeline construction

When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.

The fix here is to change cmsPipelineInsertStage to check and return
an error value. All calling code is then checked to test this return
value and cope.

gs/base/gsicc_cache.c
gs/lcms2/include/lcms2.h
gs/lcms2/src/cmscnvrt.c
gs/lcms2/src/cmsgmt.c
gs/lcms2/src/cmsio1.c
gs/lcms2/src/cmslut.c
gs/lcms2/src/cmsopt.c
gs/lcms2/src/cmstypes.c
gs/lcms2/src/cmsvirt.c


2013-03-29 10:23:50 +0000
Ken Sharp <ken.sharp@artifex.com>
8591cc53337147e77e4249a007df12cd17319d08

pdfwrite - initialise structure member 'stream_md5_valid

Bugs #693759, #693760, #693761

Found by valgrind, there were conditions under which the member would not
be initialised before we tested it, initialising it to 0 ensures this can't
happen.

In practice this is unlikely to ever cause a problem, but its best to be safe
as we could conceivably attempt to access invalid memory locations if this
member isn't initialised.

No differences expected.

gs/devices/vector/gdevpdfo.c


2013-03-28 17:51:17 -0700
Robin Watts <robin@peeves.(none)>
1ef00832581e1167dd3fd33ab499bcd1d895b218

Memory squeezing bug: lcms2 MatrixElemTypeFree

Destructors should cope with NULL.

gs/lcms2/src/cmslut.c


2013-03-28 17:26:36 -0700
Robin Watts <robin@peeves.(none)>
47d384ef4ef6a57b346a05f320a06b08309ed2d9

Memory squeezing fix: gsicc_get_link_profile

Check the return from gsicc_get_profile_handle_buffer for validity
before using it.

gs/base/gsicc_cache.c


2013-03-28 17:18:11 -0700
Robin Watts <robin@peeves.(none)>
3dc5a28f2c7fc587f4207a593d2aa32d9565d4c9

Memory squeezing fix: gsicc_alloc_link

Ensure that the gsicc_link_t has a valid wait pointer so that its
destructor can work safely in the event of the wait semaphore failing
to allocate.

gs/base/gsicc_cache.c


2013-03-28 21:12:18 +0000
Robin Watts <robin.watts@artifex.com>
b1d518660381c8cec7f603ef05eea85e1d683817

Another memory squeeze fix.

Avoid SEGV in gsicc_alloc_link_entry and callers.

gs/base/gsicc_cache.c
gs/base/gsicc_manage.c
gs/base/gsicc_nocm.c
gs/base/gsicc_replacecm.c


2013-03-28 14:25:53 -0600
Henry Stiles <henry.stiles@artifex.com>
c8e63f3b0096aac611da379b57590dca9c549aca

Fix 693730, portion of output missing resulting from type overflow.

PCL was storing image's source width and height in unsigned short
integers which is not sufficient for very large HPGL/RTL plots.

pcl/rtraster.c


2013-03-28 19:42:34 +0000
Robin Watts <robin.watts@artifex.com>
865db37918a99bdaea8825cb1173389c6541b318

Another memory squeezing fix.

Check allocations for failures. Free objects in the cleanup path.

gs/base/gsicc_manage.c


2013-03-28 19:16:56 +0000
Robin Watts <robin.watts@artifex.com>
045235372355a640bdf637a6065bfc8597e00b8e

More memory squeezing fixes.

Fix unchecked allocations, and ensure functions are capable of
distinguishing failed allocations from failing to finish normally
for some other reason.

gs/base/gsicc_cache.c
gs/base/gsicc_manage.c


2013-03-28 17:26:44 +0000
Robin Watts <robin.watts@artifex.com>
fd3220b62484c434a7c64a4f1382a0d05c82c664

Memory squeezing fixes.

Unchecked allocations and return codes in the parameter handling.

gs/base/gsdparam.c
gs/base/gsicc_manage.c


2013-03-28 13:53:51 +0000
Ken Sharp <ken.sharp@artifex.com>
120c7069563bc01b5d23d2632803607248c5fca4

pdfwrite fix previous commit

Commit 0069ae367e670a80b35d9d333c99acd71dc94108 had a 'typo' and used
the wrong member of a structure to append a hash. Because the member was
too small this caused memory corruption and later crashes.

Of course this only exhibits with the same hand-crafted test file....

No differences expected

gs/devices/vector/gdevpdfo.c


2013-03-28 13:09:11 +0000
Ken Sharp <ken.sharp@artifex.com>
0069ae367e670a80b35d9d333c99acd71dc94108

pdfwrite - fix stream MD5 hashing

Objects in pdfwrite use an MD5 hash to check for equality. The hash is lazily
created, and stored for later reuse.

The stream object hashing wasn't adding the hash of the dictionary associated
with the stream to the hash of the stream contents. This meant that 2 streams
with the same data, but different associated dictionaries, could be wrongly
identified as equal.

In practice this condition is likely to be extremely rare, it was detected
while working on the colour code and was caused by using a hand-crafted
PostScript file which reused many components when constructing multiple
colour spaces.

No differences expected

gs/devices/vector/gdevpdfo.c


2013-03-27 17:34:41 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
0e58a662c5eaa811eafa512e9cc97ae5e1303351

Add non-redudannt (nr) option to clusterpush.pl

gs/toolbin/localcluster/clusterpush.pl


2013-03-27 16:34:39 -0600
Henry Stiles <henry.stiles@artifex.com>
76f9208424f41e4177cda4a468af1b0bb6a5e166

Preliminary parsing code for the PXL VendorUnique operator.

Some lower end HP color laser printers use an undocumented diminutive
PXL-like language based on the VendorUnique operator. This commit
fleshes out enough of the parsing to get through the PXL in the test
file attached to 693661 without a syntax error. We've not done
anything to implement VendorUnique commands beyond parsing.

gs/base/gdevpxat.h
pxl/pxparse.c
pxl/pxptable.c
pxl/pxsessio.c


2013-03-27 20:48:31 +0000
Robin Watts <robin.watts@artifex.com>
5f148d93b1c954f28fead816acb5fe7131797cf4

Memory squeezing fix

If ialloc_init fails part way through, we attempt to free the allocated
objects, but we do so incorrectly as the object we get passed back is
actually internal to the allocation that was made (and there were actually
multiple allocations).

We add a function to do this properly, together with a stern warning
that this should only be used for allocation error cleanup.

gs/base/gsalloc.c
gs/base/gsalloc.h
gs/psi/ialloc.c


2013-03-27 09:20:42 -0700
Robin Watts <robin@peeves.(none)>
3f07b338211b112f8af3e95dcff87269e770a311

Another memory squeeze fix.

Ensure enumerator is initialised enough to survive gc in case
of later failures.

gs/base/gp_unifs.c
gs/psi/imain.c


2013-03-27 14:46:06 +0000
Robin Watts <robin.watts@artifex.com>
2ed2393f5a82952ba92e543a43cb39dd44c3050b

Memory squeezing fix

Check for allocation failure.

gs/psi/zcontext.c


2013-03-27 14:34:33 +0000
Robin Watts <robin.watts@artifex.com>
6f7940e28090a0f4c850e7adad4554c79fb01fb8

More memory squeezing fixes

Clear allocated structures so they can be destructed safely in the
event of later failures.

gs/base/gsfont.c
gs/base/gxccman.c


2013-03-27 14:07:17 +0000
Robin Watts <robin.watts@artifex.com>
0466008b327a5b16a051e234e4725ebfa84912f6

Another memory squeezing problem.

Check the result of the allocation in gx_cache_char_init before
using it.

gs/base/gxccman.c
gs/base/gxfcache.h
gs/psi/imain.c


2013-03-27 10:00:27 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
3d94f55fdc7babe5cbcf35aa0d3bdf43077a3de9

Fix formatting bugs in halftone generators.

gs/toolbin/halftone/gen_ordered/gen_ordered.c
gs/toolbin/halftone/gen_stochastic/gen_stochastic.c


2013-03-27 11:58:19 +0000
Robin Watts <robin.watts@artifex.com>
0d7042456a3b0c4da39d5e9bbb46b5e5379c6dc7

Another memory squeezing fix.

Ensure that the op_array_tables in the interpreter context are set
up enough that they can safely be garbage collected if allocations
fail.

gs/psi/imain.c


2013-03-27 03:52:51 -0700
Robin Watts <robin@peeves.(none)>
3b19ec49702466fa4a05a8b41087ef32c130806d

More memory squeezing fixes.

Lack of check on allocation success.

gs/psi/icontext.c
gs/psi/iinit.c
gs/psi/imainarg.c
gs/psi/zfont.c
gs/psi/zpcolor.c


2013-03-26 14:48:04 -0700
Robin Watts <robin@peeves.(none)>
4848f7302726acef5ac8c98030ec1a14ddab06b6

More memory squeezing fixes.

Mostly unchecked allocation failures when setting up the gstate.

gs/base/gscolor.c
gs/base/gsptype1.c
gs/base/gsstate.c
gs/base/gxchar.c
gs/base/gxdcolor.h


2013-03-26 13:09:49 -0700
Robin Watts <robin@peeves.(none)>
7d2e030ab25d8b31af22f0532ef813b0ff70e361

Fix various memory squeezing errors.

Mostly these are unchecked allocations, but some are errors in the
cleanup paths.

gs/base/gslibctx.c
gs/base/gsmalloc.c
gs/psi/gs.c
gs/psi/imain.c
gs/psi/interp.c
gs/psi/zgstate.c


2013-03-26 08:42:14 -0600
Henry Stiles <henry.stiles@artifex.com>
a56fae81ef7f77b1ab6dadf38b1ea7539cfca0e4

Free path upon fill failing - noticed in code review of ff515a6.

pxl/pxpaint.c


2013-03-25 15:03:42 -0600
Henry Stiles <henry.stiles@artifex.com>
fca91ea554583d6f298f1c803ccf4d395b5dc94f

Fix the fallout of a gnu indent bug introduced with the indentation
change, commit bc86bd6.

Unfortuntaly, gnu indent 2.2 adds new blank lines after each local
variable declaration when the user requests that blocks of local
declaration be separated from the procedure body with a blank line.
This fix removes the extraneous blank lines.

pcl/pcbiptrn.c
pcl/pccid.c
pcl/pccsbase.c
pcl/pcdither.c
pcl/pcdraw.c
pcl/pcfont.c
pcl/pcfontpg.c
pcl/pcfrgrnd.c
pcl/pcfsel.c
pcl/pcht.c
pcl/pcindxed.c
pcl/pcjob.c
pcl/pclookup.c
pcl/pcmacros.c
pcl/pcmtx3.c
pcl/pcommand.c
pcl/pcpage.c
pcl/pcpalet.c
pcl/pcparse.c
pcl/pcpatrn.c
pcl/pcpatxfm.c
pcl/pcrect.c
pcl/pcsfont.c
pcl/pcstatus.c
pcl/pcsymbol.c
pcl/pctop.c
pcl/pcuptrn.c
pcl/pcursor.c
pcl/pcwhtidx.c
pcl/pgchar.c
pcl/pgcolor.c
pcl/pgconfig.c
pcl/pgdraw.c
pcl/pgfdata.c
pcl/pgfont.c
pcl/pgframe.c
pcl/pggeom.c
pcl/pginit.c
pcl/pglabel.c
pcl/pglfill.c
pcl/pgmisc.c
pcl/pgparse.c
pcl/pgpoly.c
pcl/pgvector.c
pcl/rtgmode.c
pcl/rtmisc.c
pcl/rtraster.c
pcl/rtrstcmp.c
pl/dwimg.c
pl/dwmainc.c
pl/dwreg.c
pl/pjparse.c
pl/pjparsei.c
pl/plalloc.c
pl/plchar.c
pl/pldict.c
pl/plfapi.c
pl/plfont.c
pl/plht.c
pl/pllfont.c
pl/plmain.c
pl/plsrgb.c
pl/plsymbol.c
pl/pluchar.c
pl/plufont.c
pl/plulfont.c
pl/plvocab.c
pxl/pxffont.c
pxl/pxgstate.c
pxl/pximage.c
pxl/pxink.c
pxl/pxpaint.c
pxl/pxparse.c
pxl/pxpthr.c
pxl/pxsessio.c
pxl/pxstate.c
pxl/pxstream.c
pxl/pxtop.c
pxl/pxvalue.c


2013-03-25 08:47:42 -0600
Henry Stiles <henry.stiles@artifex.com>
d2a1f2e9de96d9fe70225302fd304309a19ef787

Fix reading uninitialized point (bug #693655), remove obsolete
supported conditional configurations and refactor.

A logical error in paint_path resulted in reading the cursor
uninitialized. Early in XL development NEWPATH_AFTER_PAINT and
NO_SCALED_DASH_PATTERN were added to support incorrect language in the
specification but their behavior is well established after 3 major
revisions of the PCL-XL language can be safely removed allowing
simplification of this code.

Even with those changes the paint_path procedure was much too complex
to be understandable, it is easy to see how a logical error would go
unnoticed. We try to refactor the code such that client procedures
take on some of the lifting and get rid of the gotos in hopes of
having something cohesive and correct.

pxl/pxpaint.c


2013-03-21 08:11:33 -0600
Henry Stiles <henry.stiles@artifex.com>
30273c4a9d9949f55dd4553dab614f1d36177377

Remove outdated definition.

PXL always resets the path after drawing single objects (rectangle,
ellipse, etc.) and newer versions of the specification document this
correctly consequently the compiler directive and alternate behavior
can be removed.

pxl/pxpaint.c


2013-03-26 10:20:25 +0000
Ken Sharp <ken.sharp@artifex.com>
7319905b5ba4dc3a3a66a4fa1489b653deb335fc

pdfwrite - prevent dereference of NULL pointer when no BG/UCR info present

Bug #693728 " Incompatible and large PDF output, and a crash with -dUCRandBGInfo=/Preserve"

The input is XPS and XPS has no concept of BG/UCR, so the pointer to the
information is NULL. If we had set the parameter -dUCRandBGInfo=/Preserve
then we would attempt to dereference the NULL Pointer.

We now check the pointer before attempting to dereference it.

No differences expected.

gs/devices/vector/gdevpdfg.c


2013-03-23 13:17:59 -0700
Ray Johnston <ray.johnston@artifex.com>
e76a62ee67c16f41f891a01011c7111e31643ebb

Fix MSVC support of command line FEATURE_DEVS_EXTRA and DEVICE_DEVS_EXTRA

In gs.mak these were both being set, which replaces the definition with nmake.
Without these, the definition defaults to an empty string anyway.

gs/base/gs.mak


2013-03-25 16:28:44 +0000
Ken Sharp <ken.sharp@artifex.com>
f54adf86c0f25bf9bc391e8df1af5e7ddfc0aca7

pdfwrite - always fallback for type 4 images if we change colour space

Type 4 (chroma keyed) images can't readily have their colour space changed,
if we are going to a space with fewer components. For example, if we convert
a CMYK image to Gray, then many different CMYK values will map to the same
gray value, leading to parts of the image being masked which should not be.

Technically it is possible to change colour space the other way, but it is
easier for now to simply cause all such images to use the fallback code if
we are changing colour space.

gs/devices/vector/gdevpdfi.c


2013-03-25 16:24:53 +0000
Ken Sharp <ken.sharp@artifex.com>
e3160bc0c25969e6807161f798548b763222e585

Change the colorSpace header entry in generated profiles to make pdfwrite happy

The generated profiles for certain kinds of colour space were being created
as 3CLR and 4CLR, which is absolutely fine in the general case. However,
the new pdfwrite code uses the internal 'icc_equivalent' profile generated
for a CIEBased PostScript colour space (previously pdfwrite generated its
own profile).

But The PDF Reference says that only Gray, RGB, CMYK and Lab are permissible
values for the header. So here we pretend that the generated profiles are
in either RGB or CMYK, so that the emitted PDF will be valid.

Because the profiles are only used to convert into a CIE device-independent
colour space, which will later be converted into a device space, this 'lie'
should not cause any problems (these spaces are not currently emitted at any
other point, and are never used as device profiles).

No differences expected

gs/base/gsicc_create.c


2013-03-22 10:32:07 +0000
Chris Liddell <chris.liddell@artifex.com>
563a2c68351388047d4a21501f8e042a45d0a8db

Bug 693720: make tiffsep(1) depend on the planar device

Update the makefiles to reflect that tiffsep is now a planar based device.

Also fix some of the directory settings.

No cluster differences.

gs/base/msvctail.mak
gs/base/unix-end.mak
gs/devices/devs.mak


2013-03-22 10:21:47 +0000
Ken Sharp <ken.sharp@artifex.com>
2132b46fea22c8b3fc60d18eba0c2ae58162421c

pdfwrite - only process pagelabels for pdfwrite device

Bug #693721 "Regression: file cannot be read starting with
5784bfbfba7191cacce5309e88afac0851287460"

The pagelabels are handled as device parameters rather than pdfmarks, because
the pdfmark syntax can't handle the variety of page labels possible in a
PDF file.

Of course only the pdfwrite device can handle this device parameter, so we
need to only perform this if the current device is pdfwrite.

No differences expected, cluster only tests full builds, inclusive of
the pdfwrite device.

gs/Resource/Init/pdf_main.ps


2013-03-22 01:38:24 +0000
Robin Watts <robin.watts@artifex.com>
86b1d9bea8fbd9f0e7b89730a041f1edd35ee20a

Add mujstest to list of possible user clusterpush jobs.

gs/toolbin/localcluster/clusterpush.pl


2013-03-13 13:14:22 -0700
Ray Johnston <ray.johnston@artifex.com>
b9bb3f30028c552be77554b1e7c273625d115d95

Fix bug 693079. Reduce stack usage for pattern_clist playback.

There were a couple of rather large structures on the stack in
clist_playback_band and in the tile filling. This file goes to
4 levels deep of clist_playback_band -- once for the main clist,
then patterns nested 3 deep.

gs/base/gxclrast.c


2013-03-21 12:55:07 -0700
Ray Johnston <ray.johnston@artifex.com>
9428436fa107096fd9826af8ff1a77a8616d4819

Fix compiler warning.

gs/base/gxclip2.h


2013-03-21 10:57:17 -0700
Ray Johnston <ray.johnston@artifex.com>
e4ddd5fbb12bce97f75d8039a863d32b81e2e67f

Fix bug 693718: 09-03.PS clist problem with DeviceN devices and patterns.

The clist device doesn't write masked DeviceN colors, so masked
patterns use the gx_default_fill_path method, but the pattern logic
optimizes masks that are solid to delete the mask (which is more
efficient), but then the color must be converted to a non-masked
color i.e., gx_dc_type_devn instead of gx_dc_type_devn_masked.

This file was very resolution sensitive because the pattern was
only solid at specific resolutions.

Testing shows significant improvement on comparefiles/PP0001G0.pdf.psdcmyk.300.1

gs/base/gxclip2.c
gs/base/gxp1fill.c


2013-03-21 17:19:09 +0000
Chris Liddell <chris.liddell@artifex.com>
52ee1397fa772e6534843dcff6540fa9cb5b5f11

Change jbig2dec license to AGPL to match Ghostscript.

And remove an obsolete ".cvsignore" file.

CLUSTER_UNTESTED

gs/jbig2dec/.cvsignore
gs/jbig2dec/COPYING
gs/jbig2dec/LICENSE


2013-03-21 11:39:14 +0000
Chris Liddell <chris.liddell@artifex.com>
1d8da78f4ed1e472f7cfa4589122fc3392959563

Bug 693613: add an explicit memory parameter to gs_path_enum_copy_init()

In zpathforall() the path enumerator object is allocated with the current
allocator for the Postscript VM mode. But gs_path_enum_copy_init() used the
memory pointer from the graphics state for all it's allocations, and also to
set the path enumerator's "memory" pointer.

Clearly there was the potential for problems there: in this case, the current
VM mode was global, but the graphics state was allocated in local. In this
scenario, we immediately do a GC on *local* VM after zpathforall() and before
we reach path_continue(). Because the path enumerator was allocated in global
VM, we skip it during this GC, meaning the copied path and its contents (in
local VM) were not marked, the memory considered free, and overwritten during
the compaction phase.

By adding an explicit memory parameter to gs_path_enum_copy_init() we can
ensure that all the allocations for the path enumerator are consistent, and that
the memory pointer in the enumerator is also correct.

No cluster differences.

gs/base/gspath.h
gs/base/gspath1.c
gs/psi/zpath1.c
gs/psi/zupath.c


2013-03-20 18:20:37 +0000
Robin Watts <Robin.Watts@artifex.com>
8f4156a67dae6b3d6ba627a2003617ba773a19ff

Bug 693714: Fix valgrind warnings in downsampler.

When using the special downscalers for 2/3/4, I was miscalculating
the input pointer for the right to left passes, leading to UMRs.
Fixed here.

Surprised that no one has complained of bad rendering!

gs/base/gxdownscale.c


2013-03-20 08:38:39 +0000
Ken Sharp <ken.sharp@artifex.com>
59d1b2b25262c7995e4060ec8388abf059efcf3e

Fix a couple of benign compiler warnings.

gs/devices/vector/gdevpdfg.c


2013-03-19 16:55:06 +0000
Ken Sharp <ken.sharp@artifex.com>
af327b13f517a5a7e74ccafd4c325dd378f509c3

pdfwrite - fix non-standard ranges in CIE spaces converted to ICC wiht linework

Bug #693698 "Wrong color in file with pdfwrite"

The specimen file claims to be Lab but actually isn't. The colour components
are scaled to 0->100, 0->255, 0->255 instead of 0->100, -128 -> 127, -128 -> 127

While the shading and image code scales the input values into 0->1 when emitting
an equivalent ICCBased space, the linework code did not.

This commit addresses that, and also adds code to deal with the same
issue in the new colour code.

There are a few cluster differences but the results are visually identical
or extremely similar.

gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfg.h


2013-03-19 09:38:01 +0000
Chris Liddell <chris.liddell@artifex.com>
0ce371636903391f165830d84dcbf6bc50a889bf

Bug 693611: add missing pointer to pdf14_device gc funcs

The pclist_device was missing from pdf14_device_enum_ptrs() and
pdf14_device_reloc_ptrs().

No cluster differences.

gs/base/gdevp14.c


2013-03-19 09:55:13 +0000
Ken Sharp <ken.sharp@artifex.com>
46391b4a374db77027733598ec58989eb1d31e47

pdfwrite - fix problem with discontinuous xref tables and 64-bit file sizes

Bug #693710 "Regression: Missing output with pdfwrite and 32-bit build"

The update to use 64-bit offsets for file sizes missed a case when finding
the end of an xref section. This only occurs when an object has been reserved
for future use, and then not actually used (eg a Destination for a Link on a
page which is not then produced).

Corrected the type from ulong to gs_offset_t.

No differences expected.

gs/devices/vector/gdevpdf.c


2013-03-18 20:19:48 -0600
Henry Stiles <henry.stiles@artifex.com>
bc86bd69e26b93a38ab7ee06fa2d77fb836b7c84

Indent PCL and XL in accordance with the indentation rules in
gs/doc/C-style.htm.

The program GNU indent was used to make the changes and we expect
there will be some manual cleanup over the next few days.

pcl/pcbiptrn.c
pcl/pcbiptrn.h
pcl/pccid.c
pcl/pccid.h
pcl/pccolor.c
pcl/pccoord.h
pcl/pccprint.c
pcl/pccsbase.c
pcl/pccsbase.h
pcl/pcdict.h
pcl/pcdither.c
pcl/pcdither.h
pcl/pcdraw.c
pcl/pcdraw.h
pcl/pcfont.c
pcl/pcfont.h
pcl/pcfontpg.c
pcl/pcfontst.h
pcl/pcfrgrnd.c
pcl/pcfrgrnd.h
pcl/pcfsel.c
pcl/pcfsel.h
pcl/pcht.c
pcl/pcht.h
pcl/pcident.c
pcl/pcident.h
pcl/pcimpl.c
pcl/pcindxed.c
pcl/pcindxed.h
pcl/pcjob.c
pcl/pclookup.c
pcl/pclookup.h
pcl/pcmacros.c
pcl/pcmisc.c
pcl/pcmtx3.c
pcl/pcmtx3.h
pcl/pcommand.c
pcl/pcommand.h
pcl/pcpage.c
pcl/pcpage.h
pcl/pcpalet.c
pcl/pcpalet.h
pcl/pcparam.h
pcl/pcparse.c
pcl/pcparse.h
pcl/pcpatrn.c
pcl/pcpatrn.h
pcl/pcpattyp.h
pcl/pcpatxfm.c
pcl/pcpatxfm.h
pcl/pcrect.c
pcl/pcsfont.c
pcl/pcstate.h
pcl/pcstatus.c
pcl/pcsymbol.c
pcl/pcsymbol.h
pcl/pctext.c
pcl/pctop.c
pcl/pctop.h
pcl/pctpm.h
pcl/pcuptrn.c
pcl/pcuptrn.h
pcl/pcursor.c
pcl/pcursor.h
pcl/pcwhtidx.c
pcl/pcwhtidx.h
pcl/pcxfmst.h
pcl/pgchar.c
pcl/pgcolor.c
pcl/pgconfig.c
pcl/pgdraw.c
pcl/pgdraw.h
pcl/pgfdata.c
pcl/pgfdata.h
pcl/pgfont.c
pcl/pgfont.h
pcl/pgframe.c
pcl/pggeom.c
pcl/pggeom.h
pcl/pginit.c
pcl/pginit.h
pcl/pglabel.c
pcl/pglfill.c
pcl/pgmand.h
pcl/pgmisc.c
pcl/pgmisc.h
pcl/pgparse.c
pcl/pgpoly.c
pcl/pgstate.h
pcl/pgvector.c
pcl/rtgmode.c
pcl/rtgmode.h
pcl/rtmisc.c
pcl/rtmisc.h
pcl/rtraster.c
pcl/rtraster.h
pcl/rtrstcmp.c
pcl/rtrstcmp.h
pcl/rtrstst.h
pl/dwimg.c
pl/dwimg.h
pl/dwmainc.c
pl/dwreg.c
pl/dwreg.h
pl/pjparse.c
pl/pjparse.h
pl/pjparsei.c
pl/pjtop.c
pl/pjtop.h
pl/plalloc.c
pl/plapi.h
pl/plchar.c
pl/plchar.h
pl/pldict.c
pl/pldict.h
pl/pldraw.c
pl/pldraw.h
pl/plfapi.c
pl/plfapi.h
pl/plfont.c
pl/plfont.h
pl/plftable.h
pl/plht.c
pl/plht.h
pl/plimpl.c
pl/pllfont.c
pl/pllfont.h
pl/plmain.c
pl/plmain.h
pl/plparse.h
pl/plplatf.c
pl/plplatf.h
pl/plplatfps.c
pl/plsrgb.c
pl/plsrgb.h
pl/plsymbol.c
pl/plsymbol.h
pl/pltop.c
pl/pltop.h
pl/pltoputl.c
pl/pltoputl.h
pl/pluchar.c
pl/plufont.c
pl/plufstlp.c
pl/plufstlp.h
pl/plufstlp1.c
pl/plulfont.c
pl/plvalue.c
pl/plvalue.h
pl/plvocab.c
pl/realmain.c
pxl/pxbfont.c
pxl/pxbfont.h
pxl/pxdict.h
pxl/pxerrors.c
pxl/pxerrors.h
pxl/pxffont.c
pxl/pxfont.c
pxl/pxfont.h
pxl/pxgstate.c
pxl/pxgstate.h
pxl/pximage.c
pxl/pximpl.c
pxl/pxink.c
pxl/pxoper.h
pxl/pxpaint.c
pxl/pxparse.c
pxl/pxparse.h
pxl/pxptable.c
pxl/pxptable.h
pxl/pxpthr.c
pxl/pxpthr.h
pxl/pxsessio.c
pxl/pxstate.c
pxl/pxstate.h
pxl/pxstream.c
pxl/pxtop.c
pxl/pxvalue.c
pxl/pxvalue.h


2013-03-18 16:26:48 +0000
Chris Liddell <chris.liddell@artifex.com>
962b4bd30b0b85ee5c55d548144e0d4c073a7bfb

Remove unnecessary traling $(D) from a "-I" compiler option.

No cluster differences.

gs/base/lib.mak


2013-03-18 10:59:37 +0000
Ken Sharp <ken.sharp@artifex.com>
ec0a5d96d02576c53cef22fe3e9bde5547c2f4ee

pdfwrite - improve handling of broken fonts

Bug #693711 "pdfwrite segfault"

The specimen file contains two fonts which are badly broken, in one case
the broken data stream decodes to a 'return' operation without a prior
'callsubr'. This caused the SEAC detection code to attempt to free memory
using uninitialised data, which caused a seg fault. We now detect the call
stack depth, and return an error if we return when no subroutine is executing.

This caused a later heap error, as did the other font, because the regular
type 1 font interpreter also didn't like the font data, and returned an error.
This caused us not to write a FontFile resource, but the FontDescriptor
writing code tried to write one anyway. Fixed by checking that there is a
FontFile before trying to write one.

The specimen file now runs to completion, but will not embed the broken
fonts. As a result it will only work 'correctly' on systems which have the
missing fonts available. Although given that these fonts are broken, it
seems unlikely these will work anyway.

No differences expected.

gs/base/gxtype1.c
gs/devices/vector/gdevpdtd.c


2013-03-18 08:36:00 +0000
Chris Liddell <chris.liddell@artifex.com>
fe7e1a32165f96d20d696c6b0349d338f1ec3666

Bug 693712: fix the header search path

The new devices directory wasn't correctly added to the list of "-I" compiler
options.

No cluster differences.

gs/base/lib.mak


2013-03-17 17:46:54 -0600
Henry Stiles <henry.stiles@artifex.com>
ba5fb31f9029bf622bea24ac47e089c514981f7f

Warning cleanup.

pcl/pcl.mak
pcl/pcpage.c
pcl/pctext.c
pl/pjparse.c
pl/plfont.c
pxl/pxerrors.c
pxl/pxfont.c
pxl/pxl.mak


2013-03-17 09:49:46 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
473fec16b9ff829b28d0c291eb4fc929f221d3c6

Bug 693658: Avoid overflows in image positioning.

Check for overflows to handle cases when CTM or ImageMatrix is too big.

gs/base/gxifast.c
gs/base/gxipixel.c


2013-03-16 10:38:07 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
884590d08f332a06ebf3e5db996c32210a5fc8c0

Bug 689658: Reject excessive values in CIE color spaces.

Reject CIE color spaces that have any of the attributes out of
-10000..10000 range to avoid overflows and division by 0.
This range should be sufficient for any real world color usage.

gs/psi/zcolor.c
gs/psi/zcrd.c


2013-03-16 09:08:05 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
56f34c8243ad078882df0f08cbfc10c6943fb3fe

Bug 693658: Improve validation of image parameters

To avoid overflow, check that parameter is withing the given range
before the parameter is converted to int. Stop interpolation of 0-width
or 0-length images because interpolation code divides by 0 in this case.

gs/base/gxiscale.c
gs/psi/idparam.c
gs/psi/zimage.c


2013-03-15 10:48:15 -0600
Henry Stiles <henry.stiles@artifex.com>
93bcd2277fe838838c760c4fea827d18a445ba8f

Bug 692722: Fix garbage in win32 console when using unicode filename.

In Unicode build, wide-char arguments are first converted to UTF-8 and
may be sent to stdout/stderr. So we must switch the console code page
to CP_UTF8 during main_utf8() execution to avoid utf-8/local-codepage
collision.

Thanks to Mathieu Lafon for the patch.

pl/dwmainc.c


2013-03-15 14:32:21 +0000
Chris Liddell <chris.liddell@artifex.com>
773c69e46e70bdd5482676437dafd2ca83397643

Bug 693699: replace all fopen calls with gp_fopen

Only exceptions are those in the platform specific code, and mkromfs.c.

Also, add a preprocessor define so that any unintential calls directly to
fopen will cause an error.

No cluster differences.

gs/base/fapi_ft.c
gs/base/gp_dvx.c
gs/base/gp_macio.c
gs/base/gp_mswin.c
gs/base/gp_os2.c
gs/base/gp_unifs.c
gs/base/gp_unix.c
gs/base/gp_unix_cache.c
gs/base/gp_vms.c
gs/base/gsdevice.c
gs/base/gsicc_create.c
gs/base/gsicc_lcms.c
gs/base/gsicc_lcms2.c
gs/base/gsicc_manage.c
gs/base/gsiodev.c
gs/base/gsiodisk.c
gs/base/gsiomacres.c
gs/base/gsroprun.c
gs/base/gxblend.c
gs/base/gxblend1.c
gs/base/gxiodev.h
gs/base/gxpcmap.c
gs/base/lib.mak
gs/base/mkromfs.c
gs/base/stdio_.h
gs/base/strmio.c
gs/contrib/japanese/dviprlib.c
gs/contrib/japanese/gdevdmpr.c
gs/contrib/pcl3/eprn/eprnparm.c
gs/contrib/pscolor/test.c
gs/devices/vector/gdevtxtw.c
gs/psi/apitest.c
gs/psi/gserver.c
gs/psi/int.mak
gs/psi/zfile.c
gs/psi/ziodev2.c
pl/pjparse.c
pl/plmain.c
svg/svg.mak
svg/svgtop.c
xps/xpszip.c


2013-03-15 10:13:05 +0000
Chris Liddell <chris.liddell@artifex.com>
5d49dbfa9c33dc67f7e5dbb0294056976de33521

Bug 693702: fix handling of large glyphs in FAPI/UFST

There was a logical error in the fallback case when a glyph ends up too big
for a temporary bitmap allocation in the UFST code which caused us to render
the "notdef" glyph instead of fallback to using the glyph outline to render
uncached.

CLUSTER_UNTESTED

gs/base/fapiufst.c


2013-03-14 11:59:19 -0600
Henry Stiles <henry.stiles@artifex.com>
b243adea0a7684fdb1fe755166816bafddca7666

Documentation typo fixed.

CLUSTER_UNTESTED

doc/ghostpdl.pdf
doc/ghostpdl.tex
doc/ghostpdl.txt


2013-03-14 09:11:07 +0000
Ken Sharp <ken.sharp@artifex.com>
5265796a4b8cb3d05dd72695373381135cb99c50

Remove two unused variables and a redundant function call

Flagged by compiler warnings, two variables are unused, and a function call
to set one of them is not required.

No differences expected

gs/psi/zcolor.c


2013-03-13 13:39:54 -0600
Henry Stiles <henry.stiles@artifex.com>
da27879315a810e24fc881680a2ea5e8345c9bc2

Fix trace device to compile with the new directory structure.

The trace devices were located in the lib.mak file and stopped working
(the compile broke) when gdevtrac.c was moved to the new devices/
directory.

gs/base/lib.mak
gs/devices/devs.mak


2013-03-13 14:10:55 +0000
Chris Liddell <chris.liddell@artifex.com>
044c2d5eefff2d1c92dc830b4b424856228cd083

Remove psmono, psgray and psrgb devices.

Only vestige of pswrite remaining is epswrite.

No cluster differences.

doc/who_owns_what.txt
gs/Makefile.in
gs/base/macos-mcp.mak
gs/base/openvms.mak
gs/base/openvms.mmk
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/configure.ac
gs/devices/devs.mak
gs/devices/gdevpsim.c
gs/doc/Devices.htm
gs/psi/msvc.mak
gs/psi/os2.mak
gs/toolbin/pre.chk


2013-03-13 13:33:18 +0000
Ken Sharp <ken.sharp@artifex.com>
fe10fefa06fe8405a05d4370ab6deaf14e06b122

Fix '0' return handling from dict_find_string in colour code

Bug #693685 - Wrong assumption about dict_find_string()

It seems that dict_find_string can return 0 when a string is not found in a
dictionary. This commit updates the code to deal with this (apparently unusual)
case.

No differences expected

gs/psi/zcolor.c


2013-03-11 16:17:49 -0400
Chris Liddell <chris.liddell@artifex.com>
8a95c1dff88559acbe451fa4b402fdae7f1818b3

Remove pswrite device.

epswrite and, by implication, the pswrite source remain - for now......

No cluster differences.

doc/who_owns_what.txt
gs/base/macos-mcp.mak
gs/base/macosx.mak
gs/base/openvms.mak
gs/base/openvms.mmk
gs/base/unix-gcc.mak
gs/configure.ac
gs/devices/devs.mak
gs/devices/vector/gdevps.c
gs/doc/Develop.htm
gs/doc/Devices.htm
gs/doc/Issues.htm
gs/doc/Projects.htm
gs/doc/Use.htm
gs/psi/msvc.mak
gs/psi/os2.mak
gs/toolbin/pre.chk
main/pcl6_gcc.mak
main/pcl6_msvc.mak


2013-03-13 10:27:56 +0000
Chris Liddell <chris.liddell@artifex.com>
ea86d8b5f40deff1b226c0a1bc98685f7ce34a02

Fix a missing "!endif" in msvclib.mak

CLUSTER_UNTESTED

gs/base/msvclib.mak


2013-03-12 13:29:45 -0700
Marcos H. Woehrmann <marcos.woehrmann@artifex.com>
a7b3f0ce56a0c86b3b9b1c815d0c0a402e2cb3f6

Add pdfwrite option to clusterpush.pl to run only pdfwrite and ps2write tests.

gs/toolbin/localcluster/clusterpush.pl


2013-03-11 23:09:22 +0000
unknown <ken@.(none)>
b0a5422d62b83d961a2caa5bd271d25e08495b25

Check return codes when handling CIE colour space parameters

We weren't checking some parameters, which could lead to seg faults

Bug #693659

gs/psi/zcie.c


2013-03-11 23:05:55 +0000
unknown <ken@.(none)>
b3b835e19f8a248a16ed68394c16b1e8899cf6ac

pdfwrite - limit number of pages to limit in spec

Bug #693658 - file 35a5e3ba_39da0975_973319ae_a18c13ca_ce4ba9eb.SIGSEGV.b0b

Reserving pages overflowed an integer, causing us not to reserve enough pages
we now clamp to 2^32 -1 (see PDF spec, page numbers are defined as integers)

This now runs out of memory and aborts the pdfmark.

No differences expectedd

gs/devices/vector/gdevpdfu.c


2013-03-11 17:01:39 -0400
Chris Liddell <chris.liddell@artifex.com>
943ae1102814d5248fea59b3029fa8723a47527b

Bug 693644: Remove leftover stuff about pdfopt and dumphint

No cluster differences

gs/Resource/Init/gs_init.ps
gs/base/unixinst.mak
gs/doc/Develop.htm
gs/doc/Psfiles.htm
gs/doc/Use.htm
gs/man/de/pdfopt.1
gs/man/pdfopt.1


2013-03-11 15:40:36 -0400
Chris Liddell <chris.liddell@artifex.com>
9c78f0146d0983382b54e15433c44faabc6fffcc

Bug 693686: Improve heurisic for vertical metrics from FT

Freetype "derives" vertical metrics when a font does not contain any, so we
use a heuristic to decide whether to use them, or not. With the revised FAPI
for use with the non-PS/PDF languages, the "heurstic" was "augmented" with an
unsuitably simple test - so now that simple test has been replaced with
an improved heuristic which works for both PS and PCL.

No cluster differences.

gs/base/fapi_ft.c
gs/base/gxfapi.c


2013-03-10 14:55:13 -0400
Alex Cherepanov <alex.cherepanov@artifex.com>
a9fa9038c30384eb8bc07aa53d115f6b9d94e46f

Bug 693658: Reject encoding array with non-name entries.

gs/psi/zfapi.c


2013-03-09 20:50:32 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
a431d5193985ed563a04ec71a053ddfe14026326

Bug 693681: Thansform group /BBox by /Matrix

gs/Resource/Init/pdf_draw.ps


2013-03-08 17:19:43 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
2cdd97670587903d4198ef7455742f0363502bb8

Bug 693659: Check that halftone 5 has /Default component.

gs/psi/zht2.c


2013-03-08 16:54:05 +0000
Chris Liddell <chris.liddell@artifex.com>
5f5f13ff649293cb66fa8ddcdad4a1e9bedf437f

Bug 693683: remove not needed header.

CLUSTER_UNTESTED

gs/base/fapiufst.c


2013-03-07 16:56:10 -0700
Henry Stiles <henry.stiles@artifex.com>
26a55d3991398f16a71d8369944ac75ab55aa94c

Bug 693453, remove unnecessary confusing check for a null parameter.

The width parameter is a prerequisite and does not need to be null
checked.

pl/plchar.c


2013-03-08 11:08:40 +0000
Ken Sharp <ken.sharp@artifex.com>
d337f132f69f31957b4b409a7958b45bdc2089fe

pdfwrite - Auto-rotation. Prefer auto-rotate over DSC comments

When auto-rotation is not /None we check both the heuristically determined
auto-rotate value and (for PostScript input) any DSC document or page level
comments.

Previously where these conflicted we used the DSC comments, but this seems
obtuse when the user has asked for auto-rotation. This reverses the default
so that auto-rotation will be preferred.

Also updated the documentation which incorrectly stated that Orientation
DSC comments were ignored.

Expected differences
A few files are now rotated where previously they were not

gs/devices/vector/gdevpdf.c
gs/doc/Ps2pdf.htm


2013-03-08 10:45:30 +0000
Chris Liddell <chris.liddell@artifex.com>
2ec451c463a73f66891356081f1bc9d3972a0358

Remove a pointless relative path in the VS project

CLUSTER_UNTESTED

gs/ghostscript.vcproj


2013-03-08 10:29:33 +0000
Chris Liddell <chris.liddell@artifex.com>
4aa99bb81e72592ed9adcdf6cfec8fadc001ba62

Add the VS project changes for the new devices dir

These changes somehow went awol when I committed the directory reorg.

CLUSTER_UNTESTED

gs/ghostscript.vcproj


2013-03-07 23:44:25 -0800
Ray Johnston <ray.johnston@artifex.com>
7cc7b0adb8203fbc94ce4613e4eefa12d9de0b2c

Fix compiler warning and trailing whitespace issues.

gs/base/gsequivc.c


2013-03-07 16:18:47 -0800
Ray Johnston <ray.johnston@artifex.com>
7fd565cebe1add96bf09527530c1f30365090cc5

Clean up some indents that used tabs.

gs/base/gdevp14.c


2013-01-12 19:41:09 -0800
Ray Johnston <ray.johnston@artifex.com>
6c4990bb6f8f4e5d7484b9b183ea9caaa5eaedee

Remove force of -Z: used during development.

gs/psi/imain.c


2012-08-27 15:57:59 -0700
Ray Johnston <ray.johnston@artifex.com>
abc6c492a11f63ee416ecd287d980a0cb134421e

Finally get rid of band_complexity and write/read color_usage_array from clist.

This also gets rid of the hackish fixed length band_color_usage in the page_info
in favor of a dynamically allocated structure that has one entry per band.

A few minor git gripes cleaned up for the commit (trailing whitespace) in the
affected files.

gs/base/gdevppla.c
gs/base/gdevppla.h
gs/base/gdevprn.c
gs/base/gdevprn.h
gs/base/gxband.h
gs/base/gxcldev.h
gs/base/gxclimag.c
gs/base/gxclist.c
gs/base/gxclist.h
gs/base/gxclpath.c
gs/base/gxclread.c
gs/base/gxclrect.c
gs/base/gxclthrd.c
gs/base/gxclutil.c
gs/base/gxdevbuf.h
gs/devices/gdevijs.c
gs/devices/gdevplib.c
gs/devices/gdevpng.c
gs/psi/imain.c


2012-05-09 09:31:46 -0700
Ray Johnston <ray.johnston@artifex.com>
aa5ee8102a4a98c8cef55b4ee9f347b9bdf94036

Optimize PDF 1.4 transparency when using the clist.

Keep track of the bbox for the actual transparency rect in each band,
and skip pdf14 compositor actions on playback for bands with an empty
bbox. Bands that only paint to the page level with alpha == 1 don't
need the compositor. -Z: prints the number of bands skipped.

gs/base/gdevp14.c
gs/base/gdevprn.c
gs/base/gsropt.h
gs/base/gxband.h
gs/base/gxcldev.h
gs/base/gxclimag.c
gs/base/gxclist.c
gs/base/gxclist.h
gs/base/gxclpath.c
gs/base/gxclrast.c
gs/base/gxclread.c
gs/base/gxclrect.c
gs/base/gxclutil.c
gs/base/lib.mak


2013-03-07 14:06:36 -0800
Ray Johnston <ray.johnston@artifex.com>
dde01090d9251f0752583fa0524d0db7e5b1531d

Fix indeterminate results caused by UMR of render_cond.

Seen with tests_private/pdf/PDFIA1.7_SUBSET/CATX4988.pdf and other
files (psdcmyk device). Function capture_spot_equivalent_cmyk_colors
uses a 'temp_profile' but didn't initialize the rendercond
array which could change the link profile that was generated.
Also (just in case) set the devicegraytok element.

gs/base/gsequivc.c


2013-03-06 11:17:49 -0800
Ray Johnston <ray.johnston@artifex.com>
b2716c4d4862d357d52e3046f512bf4a93b71296

Fix missing dependency of gxpcolor.h

gs/base/lib.mak


2013-03-07 14:05:59 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
0deeb9ece0637d0d1e8f2d6d03cea3e245330856

Bug 693659: Check that CalRGB is a dictionary.

gs/psi/zcolor.c


2013-03-07 13:40:58 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
4e43623be06fc7dbae01071ab78b5e9f9e70f133

Bug 693659: Check that halftone name is a name.

gs/psi/zht2.c


2013-03-07 12:41:53 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
8f972acdde3a09fc37e76826dafec44f8d9ee603

Bug 693659: Check for file name buffer overflow.

gs/psi/zfile.c


2013-03-07 09:15:07 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
2e32682a2530afae04e2d1988da06740d92f7808

Bug 693659: Skip empty strings in sfnts array.

gs/psi/zfapi.c


2013-03-07 00:45:41 +0000
Robin Watts <robin.watts@artifex.com>
6961e71d7b6b9162f6b75fae60469175a4c8d43e

Bug 692862: Fix stroking problem with antialiasing

The fix for bug 691228 causes problems in some cases; when joining
two segment that are directly in line with the next, we add a
circular line cap to ensure correct rendering. Which side of this
end cap we end up on depends on which direction the line then
continues in.

gs/base/gxstroke.c


2013-03-06 09:30:38 -0800
Ray Johnston <ray.johnston@artifex.com>
d3d66fddadc345aab1139397e10b1ab200af2c99

Fix infinite recursion (caused segfault) introduced with commit 70ba7029.

The fix to mem_planar_fill_rectangle_hl_color did not account for the
devn_masked color type which can also be handled.

gs/base/gdevmpla.c


2013-03-06 10:15:14 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
0f541c553afe098f84f19557e4a19bb18e803b91

Bug 693659: Reject functions with 1-point domain.

gs/psi/zfunc.c


2013-02-26 18:01:40 +0000
Chris Liddell <chris.liddell@artifex.com>
f1488c5aff54f37ee67759827d4298592af5dbc8

Move output devices to their own directory.

Also put the vector devices in their own directory, so we have:
gs/devices

and

gs/devices/vector

This is a first pass - further refinement may be required!

No cluster differences.

common/msvc_top.mak
common/ugcc_top.mak
gs/Makefile.in
gs/autogen.sh
gs/base/Makefile.in
gs/base/configure.ac
gs/base/contrib.mak
gs/base/devs.mak
gs/base/gdev3852.c
gs/base/gdev3b1.c
gs/base/gdev4081.c
gs/base/gdev4693.c
gs/base/gdev8510.c
gs/base/gdev8bcm.c
gs/base/gdev8bcm.h
gs/base/gdevadmp.c
gs/base/gdevagl.c
gs/base/gdevagl.h
gs/base/gdevatx.c
gs/base/gdevbit.c
gs/base/gdevbj10.c
gs/base/gdevbjc.h
gs/base/gdevbjcl.c
gs/base/gdevbjcl.h
gs/base/gdevbmp.c
gs/base/gdevbmp.h
gs/base/gdevbmpa.c
gs/base/gdevbmpc.c
gs/base/gdevccr.c
gs/base/gdevcdj.c
gs/base/gdevcfax.c
gs/base/gdevcif.c
gs/base/gdevclj.c
gs/base/gdevcljc.c
gs/base/gdevcp50.c
gs/base/gdevcslw.c
gs/base/gdevdfax.c
gs/base/gdevdjet.c
gs/base/gdevdjtc.c
gs/base/gdevdljm.c
gs/base/gdevdljm.h
gs/base/gdevdm24.c
gs/base/gdevdsp.c
gs/base/gdevdsp.h
gs/base/gdevdsp2.h
gs/base/gdevepsc.c
gs/base/gdevepsn.c
gs/base/gdevescp.c
gs/base/gdevevga.c
gs/base/gdevfax.c
gs/base/gdevfax.h
gs/base/gdevherc.c
gs/base/gdevhl7x.c
gs/base/gdevicov.c
gs/base/gdevifno.c
gs/base/gdevijs.c
gs/base/gdevimgn.c
gs/base/gdevjbig2.c
gs/base/gdevjpeg.c
gs/base/gdevjpx.c
gs/base/gdevl256.c
gs/base/gdevl31s.c
gs/base/gdevlbp8.c
gs/base/gdevlj56.c
gs/base/gdevlp8k.c
gs/base/gdevlxm.c
gs/base/gdevmac.c
gs/base/gdevmac.h
gs/base/gdevmacpictop.h
gs/base/gdevmacttf.h
gs/base/gdevmeds.c
gs/base/gdevmeds.h
gs/base/gdevmgr.c
gs/base/gdevmgr.h
gs/base/gdevmiff.c
gs/base/gdevmswn.c
gs/base/gdevmswn.h
gs/base/gdevmsxf.c
gs/base/gdevn533.c
gs/base/gdevo182.c
gs/base/gdevokii.c
gs/base/gdevos2p.c
gs/base/gdevp2up.c
gs/base/gdevpbm.c
gs/base/gdevpcfb.c
gs/base/gdevpcfb.h
gs/base/gdevpcl.c
gs/base/gdevpcl.h
gs/base/gdevpcx.c
gs/base/gdevpdf.c
gs/base/gdevpdfb.c
gs/base/gdevpdfb.h
gs/base/gdevpdfc.c
gs/base/gdevpdfc.h
gs/base/gdevpdfd.c
gs/base/gdevpdfe.c
gs/base/gdevpdfg.c
gs/base/gdevpdfg.h
gs/base/gdevpdfi.c
gs/base/gdevpdfj.c
gs/base/gdevpdfk.c
gs/base/gdevpdfm.c
gs/base/gdevpdfo.c
gs/base/gdevpdfo.h
gs/base/gdevpdfp.c
gs/base/gdevpdfr.c
gs/base/gdevpdft.c
gs/base/gdevpdfu.c
gs/base/gdevpdfv.c
gs/base/gdevpdfx.h
gs/base/gdevpdt.c
gs/base/gdevpdt.h
gs/base/gdevpdtb.c
gs/base/gdevpdtb.h
gs/base/gdevpdtc.c
gs/base/gdevpdtd.c
gs/base/gdevpdtd.h
gs/base/gdevpdte.c
gs/base/gdevpdtf.c
gs/base/gdevpdtf.h
gs/base/gdevpdti.c
gs/base/gdevpdti.h
gs/base/gdevpdts.c
gs/base/gdevpdts.h
gs/base/gdevpdtt.c
gs/base/gdevpdtt.h
gs/base/gdevpdtv.c
gs/base/gdevpdtv.h
gs/base/gdevpdtw.c
gs/base/gdevpdtw.h
gs/base/gdevpdtx.h
gs/base/gdevpe.c
gs/base/gdevperm.c
gs/base/gdevphex.c
gs/base/gdevpjet.c
gs/base/gdevplan.c
gs/base/gdevplib.c
gs/base/gdevplib.h
gs/base/gdevpm.h
gs/base/gdevpng.c
gs/base/gdevps.c
gs/base/gdevpsd.c
gs/base/gdevpsdf.h
gs/base/gdevpsdi.c
gs/base/gdevpsdp.c
gs/base/gdevpsds.c
gs/base/gdevpsds.h
gs/base/gdevpsdu.c
gs/base/gdevpsf.h
gs/base/gdevpsf1.c
gs/base/gdevpsf2.c
gs/base/gdevpsfm.c
gs/base/gdevpsft.c
gs/base/gdevpsfu.c
gs/base/gdevpsfx.c
gs/base/gdevpsim.c
gs/base/gdevpsu.c
gs/base/gdevpsu.h
gs/base/gdevpx.c
gs/base/gdevpxut.c
gs/base/gdevpxut.h
gs/base/gdevrinkj.c
gs/base/gdevs3ga.c
gs/base/gdevsco.c
gs/base/gdevsgi.c
gs/base/gdevsgi.h
gs/base/gdevsj48.c
gs/base/gdevsnfb.c
gs/base/gdevsppr.c
gs/base/gdevstc.c
gs/base/gdevstc.h
gs/base/gdevstc1.c
gs/base/gdevstc2.c
gs/base/gdevstc3.c
gs/base/gdevstc4.c
gs/base/gdevsun.c
gs/base/gdevsunr.c
gs/base/gdevsvg.c
gs/base/gdevsvga.c
gs/base/gdevsvga.h
gs/base/gdevtfax.c
gs/base/gdevtfax.h
gs/base/gdevtfnx.c
gs/base/gdevtifs.c
gs/base/gdevtifs.h
gs/base/gdevtknk.c
gs/base/gdevtrac.c
gs/base/gdevtsep.c
gs/base/gdevtxtw.c
gs/base/gdevupd.c
gs/base/gdevvglb.c
gs/base/gdevwddb.c
gs/base/gdevwdib.c
gs/base/gdevwpr2.c
gs/base/gdevwprn.c
gs/base/gdevx.c
gs/base/gdevx.h
gs/base/gdevxalt.c
gs/base/gdevxcf.c
gs/base/gdevxcmp.c
gs/base/gdevxcmp.h
gs/base/gdevxini.c
gs/base/gdevxps.c
gs/base/gdevxres.c
gs/base/gxfcopy.c
gs/base/gxfcopy.h
gs/base/lib.mak
gs/base/macos-mcp.mak
gs/base/macosx.mak
gs/base/minftrsz.c
gs/base/minftrsz.h
gs/base/msvclib.mak
gs/base/opdfread.h
gs/base/openvms.mak
gs/base/openvms.mmk
gs/base/pcwin.mak
gs/base/rinkj/evenbetter-rll.c
gs/base/rinkj/evenbetter-rll.h
gs/base/rinkj/rinkj-byte-stream.c
gs/base/rinkj/rinkj-byte-stream.h
gs/base/rinkj/rinkj-config.c
gs/base/rinkj/rinkj-config.h
gs/base/rinkj/rinkj-device.c
gs/base/rinkj/rinkj-device.h
gs/base/rinkj/rinkj-dither.c
gs/base/rinkj/rinkj-dither.h
gs/base/rinkj/rinkj-epson870.c
gs/base/rinkj/rinkj-epson870.h
gs/base/rinkj/rinkj-screen-eb.c
gs/base/rinkj/rinkj-screen-eb.h
gs/base/ugcclib.mak
gs/base/unix-dll.mak
gs/base/unix-gcc.mak
gs/base/unixansi.mak
gs/base/whitelst.c
gs/base/whitelst.h
gs/base/winlib.mak
gs/configure.ac
gs/contrib/contrib.mak
gs/devices/contrib.mak
gs/devices/devs.mak
gs/devices/gdev3852.c
gs/devices/gdev3b1.c
gs/devices/gdev4081.c
gs/devices/gdev4693.c
gs/devices/gdev8510.c
gs/devices/gdev8bcm.c
gs/devices/gdev8bcm.h
gs/devices/gdevadmp.c
gs/devices/gdevatx.c
gs/devices/gdevbit.c
gs/devices/gdevbj10.c
gs/devices/gdevbjc.h
gs/devices/gdevbjcl.c
gs/devices/gdevbjcl.h
gs/devices/gdevbmp.c
gs/devices/gdevbmp.h
gs/devices/gdevbmpa.c
gs/devices/gdevbmpc.c
gs/devices/gdevccr.c
gs/devices/gdevcdj.c
gs/devices/gdevcfax.c
gs/devices/gdevcif.c
gs/devices/gdevclj.c
gs/devices/gdevcljc.c
gs/devices/gdevcp50.c
gs/devices/gdevcslw.c
gs/devices/gdevdfax.c
gs/devices/gdevdjet.c
gs/devices/gdevdjtc.c
gs/devices/gdevdljm.c
gs/devices/gdevdljm.h
gs/devices/gdevdm24.c
gs/devices/gdevdsp.c
gs/devices/gdevdsp.h
gs/devices/gdevdsp2.h
gs/devices/gdevepsc.c
gs/devices/gdevepsn.c
gs/devices/gdevescp.c
gs/devices/gdevevga.c
gs/devices/gdevfax.c
gs/devices/gdevfax.h
gs/devices/gdevherc.c
gs/devices/gdevhl7x.c
gs/devices/gdevicov.c
gs/devices/gdevifno.c
gs/devices/gdevijs.c
gs/devices/gdevimgn.c
gs/devices/gdevjbig2.c
gs/devices/gdevjpeg.c
gs/devices/gdevjpx.c
gs/devices/gdevl256.c
gs/devices/gdevl31s.c
gs/devices/gdevlbp8.c
gs/devices/gdevlp8k.c
gs/devices/gdevlxm.c
gs/devices/gdevmac.c
gs/devices/gdevmac.h
gs/devices/gdevmacpictop.h
gs/devices/gdevmacttf.h
gs/devices/gdevmeds.c
gs/devices/gdevmeds.h
gs/devices/gdevmgr.c
gs/devices/gdevmgr.h
gs/devices/gdevmiff.c
gs/devices/gdevmswn.c
gs/devices/gdevmswn.h
gs/devices/gdevmsxf.c
gs/devices/gdevn533.c
gs/devices/gdevo182.c
gs/devices/gdevokii.c
gs/devices/gdevos2p.c
gs/devices/gdevp2up.c
gs/devices/gdevpbm.c
gs/devices/gdevpcfb.c
gs/devices/gdevpcfb.h
gs/devices/gdevpcl.c
gs/devices/gdevpcl.h
gs/devices/gdevpcx.c
gs/devices/gdevpe.c
gs/devices/gdevperm.c
gs/devices/gdevphex.c
gs/devices/gdevpjet.c
gs/devices/gdevplan.c
gs/devices/gdevplib.c
gs/devices/gdevplib.h
gs/devices/gdevpm.h
gs/devices/gdevpng.c
gs/devices/gdevpsd.c
gs/devices/gdevpsim.c
gs/devices/gdevrinkj.c
gs/devices/gdevs3ga.c
gs/devices/gdevsco.c
gs/devices/gdevsgi.c
gs/devices/gdevsgi.h
gs/devices/gdevsj48.c
gs/devices/gdevsnfb.c
gs/devices/gdevsppr.c
gs/devices/gdevstc.c
gs/devices/gdevstc.h
gs/devices/gdevstc1.c
gs/devices/gdevstc2.c
gs/devices/gdevstc3.c
gs/devices/gdevstc4.c
gs/devices/gdevsun.c
gs/devices/gdevsunr.c
gs/devices/gdevsvga.c
gs/devices/gdevsvga.h
gs/devices/gdevtfax.c
gs/devices/gdevtfax.h
gs/devices/gdevtfnx.c
gs/devices/gdevtifs.c
gs/devices/gdevtifs.h
gs/devices/gdevtknk.c
gs/devices/gdevtrac.c
gs/devices/gdevtsep.c
gs/devices/gdevupd.c
gs/devices/gdevvglb.c
gs/devices/gdevwddb.c
gs/devices/gdevwdib.c
gs/devices/gdevwpr2.c
gs/devices/gdevwprn.c
gs/devices/gdevx.c
gs/devices/gdevx.h
gs/devices/gdevxalt.c
gs/devices/gdevxcf.c
gs/devices/gdevxcmp.c
gs/devices/gdevxcmp.h
gs/devices/gdevxini.c
gs/devices/gdevxres.c
gs/devices/gxfcopy.c
gs/devices/gxfcopy.h
gs/devices/minftrsz.c
gs/devices/minftrsz.h
gs/devices/rinkj/evenbetter-rll.c
gs/devices/rinkj/evenbetter-rll.h
gs/devices/rinkj/rinkj-byte-stream.c
gs/devices/rinkj/rinkj-byte-stream.h
gs/devices/rinkj/rinkj-config.c
gs/devices/rinkj/rinkj-config.h
gs/devices/rinkj/rinkj-device.c
gs/devices/rinkj/rinkj-device.h
gs/devices/rinkj/rinkj-dither.c
gs/devices/rinkj/rinkj-dither.h
gs/devices/rinkj/rinkj-epson870.c
gs/devices/rinkj/rinkj-epson870.h
gs/devices/rinkj/rinkj-screen-eb.c
gs/devices/rinkj/rinkj-screen-eb.h
gs/devices/vector/gdevagl.c
gs/devices/vector/gdevagl.h
gs/devices/vector/gdevlj56.c
gs/devices/vector/gdevpdf.c
gs/devices/vector/gdevpdfb.c
gs/devices/vector/gdevpdfb.h
gs/devices/vector/gdevpdfc.c
gs/devices/vector/gdevpdfc.h
gs/devices/vector/gdevpdfd.c
gs/devices/vector/gdevpdfe.c
gs/devices/vector/gdevpdfg.c
gs/devices/vector/gdevpdfg.h
gs/devices/vector/gdevpdfi.c
gs/devices/vector/gdevpdfj.c
gs/devices/vector/gdevpdfk.c
gs/devices/vector/gdevpdfm.c
gs/devices/vector/gdevpdfo.c
gs/devices/vector/gdevpdfo.h
gs/devices/vector/gdevpdfp.c
gs/devices/vector/gdevpdfr.c
gs/devices/vector/gdevpdft.c
gs/devices/vector/gdevpdfu.c
gs/devices/vector/gdevpdfv.c
gs/devices/vector/gdevpdfx.h
gs/devices/vector/gdevpdt.c
gs/devices/vector/gdevpdt.h
gs/devices/vector/gdevpdtb.c
gs/devices/vector/gdevpdtb.h
gs/devices/vector/gdevpdtc.c
gs/devices/vector/gdevpdtd.c
gs/devices/vector/gdevpdtd.h
gs/devices/vector/gdevpdte.c
gs/devices/vector/gdevpdtf.c
gs/devices/vector/gdevpdtf.h
gs/devices/vector/gdevpdti.c
gs/devices/vector/gdevpdti.h
gs/devices/vector/gdevpdts.c
gs/devices/vector/gdevpdts.h
gs/devices/vector/gdevpdtt.c
gs/devices/vector/gdevpdtt.h
gs/devices/vector/gdevpdtv.c
gs/devices/vector/gdevpdtv.h
gs/devices/vector/gdevpdtw.c
gs/devices/vector/gdevpdtw.h
gs/devices/vector/gdevpdtx.h
gs/devices/vector/gdevps.c
gs/devices/vector/gdevpsdf.h
gs/devices/vector/gdevpsdi.c
gs/devices/vector/gdevpsdp.c
gs/devices/vector/gdevpsds.c
gs/devices/vector/gdevpsds.h
gs/devices/vector/gdevpsdu.c
gs/devices/vector/gdevpsf.h
gs/devices/vector/gdevpsf1.c
gs/devices/vector/gdevpsf2.c
gs/devices/vector/gdevpsfm.c
gs/devices/vector/gdevpsft.c
gs/devices/vector/gdevpsfu.c
gs/devices/vector/gdevpsfx.c
gs/devices/vector/gdevpsu.c
gs/devices/vector/gdevpsu.h
gs/devices/vector/gdevpx.c
gs/devices/vector/gdevpxut.c
gs/devices/vector/gdevpxut.h
gs/devices/vector/gdevsvg.c
gs/devices/vector/gdevtxtw.c
gs/devices/vector/gdevxps.c
gs/devices/vector/opdfread.h
gs/devices/vector/whitelst.c
gs/devices/vector/whitelst.h
gs/psi/int.mak
gs/psi/msvc.mak
gs/psi/winint.mak
gs/psi/zfapi.c
main/pcl6_gcc.mak
main/pcl6_msvc.mak
pl/pl.mak
svg/svg_gcc.mak
svg/svg_msvc.mak
xps/xps_gcc.mak
xps/xps_msvc.mak


2013-03-06 01:43:29 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
6207ac0c8158b28bd2e9ff8633dd94fc91d98057

Bug 693659: fix integer overflow in Type 2 font parser.

gs/psi/zfont2.c


2013-03-06 00:44:26 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
4147f14b1460c35620cb117821fcb01f3b7a1e3d

Bug 693659: Improve argument validation in ArcfourDecode operator.

gs/psi/zfarc4.c


2013-03-05 19:08:49 -0800
Ray Johnston <ray.johnston@artifex.com>
70ba7029bc563bab7a24bff27decad5feceba4f8

Fix indeterminate page background with plank and comparefiles/104-01.ps

This file uses the PS erasepage operator to paint the background to
a non-white value. The mem_planar_fill_rectangle_hl_color used the
'devn' colors without checking the type. With the plank device these
colors were 'pure' or 'ht_binary' so the devn values were bogus.
If the color type was binary, an address was used as color values.
A pure color was OK as long as the number of planes did not exceed
the size of the gx_color_index and the bytes in the color index
corresponded to the planes.

Also add warning (DEBUG build) if mem_planar_strip_tile_rect_devn
ever uses non-devn colors.

Progressions with 104-01.ps, 12-05.PS, 12-07B.PS and 29-07A.PS

gs/base/gdevmpla.c
gs/base/lib.mak


2013-03-05 22:24:56 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
04986f44befa8d71e64a94fafc31ee000c48cc78

Bug 693659: Add check for 0 pointer to zlib message.

gs/base/szlibd.c


2013-03-05 11:52:58 -0800
Ray Johnston <ray.johnston@artifex.com>
675682cee0a3dc6cd346084489712505f5ff3ee4

Fix image_color_cache_init to avoid using out of range data.

If the indexed color space hival is less than the num_entries in
the color_cache, the code would just convert using values past
the end of the lookup data, and image_render_mono_ht did not
clamp values either.

Seen with pbmraw sumatra/x_-_integer_overflow_in_fz_newpixmap.pdf
This file shows clear progression, some other files show differences
but all seem trivial and are pcl files. Maybe a ROP problem.

gs/base/gxipixel.c


2013-03-05 12:48:14 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
69858556e95a2762ef48109ab7b265f2e87e2272

Bug 693659: Fix access to /Colorants entry in DeviceN CSA.

gs/psi/zcolor.c


2013-03-05 01:40:11 -0500
Alex Cherepanov <alex.cherepanov@artifex.com>
0950755f0dc971ebe2387a587688075751eb0905

Bug 693659: Fix underflow checking in Type 2 parser.

gs/psi/zfont2.c


2013-03-05 12:16:51 +0000
Chris Liddell <chris.liddell@artifex.com>
486ee97ee8e11cc1edce8998d0a85907c16721f5

Bug 693674: introduce memory limit for UFST bitmaps

Previously, UFST had "unlimited" memory for glyph bitmaps. This appears to allow
bitmaps large enough to cause an overflow in the UFST rendering code.

Now there is a limit on the memory UFST can allocate for a bitmap (tied to the
maximum "interim" bitmap Ghostscript will allocate when creating an entry for
the glyph cache).

This has two benefits: prevents the crash by avoiding the rendering overflow in
UFST, and prevents us from pointlessly allocating huge glyph bitmaps in cases
where we really want to render from an outline anyway.

No cluster differences.

gs/base/gxchar.c
gs/base/gxchar.h
gs/base/gxfapi.c
gs/base/gxfapiu.c


2013-03-05 10:29:02 +0000
Ken Sharp <ken.sharp@artifex.com>
26b50d7d18681f25ae0a435830fb291814b889b1

pdfwrite - new colour code, fix image conversion to base space

An oversight in the code led to images (other than imagemasks) not being
converted to the specified process colour.

No differences expected

gs/base/gdevpdfi.c


2013-03-05 10:08:54 +0000
Ken Sharp <ken.sharp@artifex.com>
db3494dbb682781aca7651ffc60d80a8eeefec72

pdfwrite - new colour code fix a Seg fault with Sep/DeviceN

When converting Separation or DeviceN spaces to a device space we actually
(currently) write them as ICCBased spaces. But the 'convert' flag was left
at non-zero, leading to us attempting to convert. Since the original space
wasn't recorded, this caused a seg fault.

No differences expected

gs/base/gdevpdfi.c


2013-03-04 20:43:19 -0800
Ray Johnston <