Bug 690791 - Random noise reading PDF file
Summary: Random noise reading PDF file
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Images (show other bugs)
Version: master
Hardware: All All
: P2 normal
Assignee: Ralph Giles
URL:
Keywords: bountiable
: 690913 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-29 20:51 UTC by Marcos H. Woehrmann
Modified: 2011-09-18 21:47 UTC (History)
1 user (show)

See Also:
Customer: 170
Word Size: ---


Attachments
Bug690791.diff (7.76 KB, patch)
2009-11-23 21:41 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 2009-09-29 20:51:02 UTC
The customer reports and I've verified that instead of the expected output the attached PDF file 
produces random noise when read by Ghostscript.  gs8.64, gs8.70, and head (r10102) all behave the 
same way.

The command line I'm using for testing:

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

Note that this is an OCR'd PDF file, consisting of a page of text with an image on top.  The problem 
appears to be with Ghostscript reading the image; if instead of TIFF you convert the attached file to PDF 
and then view it in Acrobat you can see the OCR'd text being drawn before being overlaid with the 
random noise image.
Comment 1 Marcos H. Woehrmann 2009-09-29 20:51:46 UTC
Created attachment 5413 [details]
OriginalFile.pdf
Comment 2 Alex Cherepanov 2009-10-05 20:39:39 UTC
Created attachment 5449 [details]
a8-2i4.pdf

Simplified sample file that has only JBIG2 image.
Comment 3 Ray Johnston 2009-10-28 09:25:59 UTC
Customer reports that this is a critical issue for them.
Comment 4 Ralph Giles 2009-10-29 02:52:25 UTC
Just an update. We appear to be decoding the symbol dictionary and text region
correctly, but not the final generic region. Disabling the fourth segment gives
proper results.
Comment 5 Ralph Giles 2009-11-20 10:15:56 UTC
The problem is the file includes a refinement region with typical prediction,
which we haven't implemented. Resolution of the bug just requires doing so.

In the meantime, I've committed a work-around patch to skip the refinement data
when we can't decode it as r10362. With this patch, rendering is not completely
correct, but is much better as it removes the obscuring layer of noise.
Comment 6 Ralph Giles 2009-11-23 17:35:49 UTC
*** Bug 690913 has been marked as a duplicate of this bug. ***
Comment 7 Ralph Giles 2009-11-23 21:41:31 UTC
Created attachment 5705 [details]
Bug690791.diff

Attaching a backport patch against 8.64/8.70 which fixes the problem.
Comment 8 Marcos H. Woehrmann 2011-09-18 21:47:25 UTC
Changing customer bugs that have been resolved more than a year ago to closed.