Fix for Bug 686980, stripes in pdf.

"Jeong Kim" <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <000701c360ca$d6a95df0$0400a8c0@daedun>
Reviewers,

In the given sample file, some parts of the pictures are using DCTDecode
filter 
with DeviceCMYK color space, but component id values in the stream data
are not unique for each color channels. Again, they use same id values
(1) for both cyan and black channel.

This makes a serious conflict and then jpeg decoder over-writes data for
black 
channel onto cyan channel for this reason. Therefore, output cyan
channel has 
data for black and black channel has dummy data.

That's why we have noisy black output and cyan images instead of black
ones.

These problems are due to incorrect input data not to Ghostscript or
jpeg library. But Adobe Acrobat reads this file corretly. So I did a
clumsy hack on jpeg library.

In jpeg/jdmarker.c

282:    	INPUT_BYTE(cinfo, compptr->component_id, return FALSE);
	compptr->component_id = ci+1; <---

327:    	INPUT_BYTE(cinfo, cc, return FALSE);
    	cc = i+1; <---

I inserted two arrow-marked lines. Now jpeg library ignores the
component id values from input stream. It just generates ids
sequentially.

Now everything is OK. But I think modifying jpeg library instead of
Ghostscript could be problematic. Any advice or comment on this issue is
welcome.

Jeong
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.