Bug 690174 - PDF file converted with vertical lines
Summary: PDF file converted with vertical lines
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Images (show other bugs)
Version: master
Hardware: Macintosh MacOS X
: P1 normal
Assignee: Ralph Giles
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-18 08:25 UTC by Marcos H. Woehrmann
Modified: 2011-10-02 02:35 UTC (History)
2 users (show)

See Also:
Customer: 531
Word Size: ---


Attachments
jpxd-4bit.diff (2.62 KB, patch)
2009-06-17 22:18 UTC, Ralph Giles
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2008-11-18 08:25:06 UTC
The customer reports and I've verified that the attached PDF file has spurious vertical lines when converted 
by Ghostscripted gs8.63 and head (r9230).  These lines do not appear when the file is opened with Acrobat 
9.0 or Apple Preview.

The command line I'm using for testing:

  bin/gs -sDEVICE=tiff24nc -o test.tif ./lakeville_upa_plan_set_21.pdf

Converting the file with the luratech decoders does not change the output.
Comment 1 Marcos H. Woehrmann 2008-11-18 08:25:50 UTC
Created attachment 4604 [details]
lakeville_upa_plan_set_21_g.pdf
Comment 2 Alex Cherepanov 2008-11-19 11:35:50 UTC
This file has /JPXDecode image with /BitsPerComponent 4 .

Ghostscript interprets high bytes of the data stream as a black pixel causing
wrong black stripes and the wrong line length.

With /BitsPerComponent 8 the scan line length becomes correct but the values
received from the filter are too small and look black. So /JPXDecode
need to scale this kind of data up.

Comment 3 Ray Johnston 2008-11-19 11:43:05 UTC
Assigning to Ralph since this is apparently a JPXDecode issue.
Comment 4 Ralph Giles 2009-05-05 16:09:18 UTC
Alex's analysis is correct. Jasper is correctly decoding the image, but the
interface code in sjpx.c incorrectly assumes the component with stored with 8 or
more bits of precision, when the image has just four, in both the scaling and
the stride calculation.
Comment 5 Ralph Giles 2009-06-17 22:18:55 UTC
Created attachment 5120 [details]
jpxd-4bit.diff

Attaching a minimal patch which fixes the bug, with no expected side effects.
This was committed at r9801 and will be part of the next release.
Comment 6 Ralph Giles 2009-06-17 22:45:00 UTC
Closing the bug since the customer issue is resolved and there are no related
regressions.

I've opened 690545 for tracking some related improvements for non-8-bit images.
Comment 7 Alex Cherepanov 2010-12-05 21:48:22 UTC
With Luratech decoder the lines are still there and debug MSVC build
complains about heap damage.
Comment 8 Alex Cherepanov 2010-12-06 16:43:25 UTC
The Luratech problem has been fixed by the rev. 691816. See bug 691816.