Bug 695387 - PDF with jpeg2000 conversion problems
Summary: PDF with jpeg2000 conversion problems
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: JPX/JBIG2 encode/decode (show other bugs)
Version: master
Hardware: PC Windows NT
: P2 major
Assignee: Marcos H. Woehrmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-25 11:07 UTC by Mike
Modified: 2014-10-19 19:28 UTC (History)
1 user (show)

See Also:
Customer: 631
Word Size: ---


Attachments
PDF file (432.08 KB, application/pdf)
2014-07-25 11:07 UTC, Mike
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike 2014-07-25 11:07:02 UTC
Created attachment 11079 [details]
PDF file

When converting the attached PDF into PDF / TIFF / PNG with GS head the output file looks wrong. I get the same problem with older GS versions. Also tried building GS with luratech jpeg2000 engine - same problem.
Comment 1 Marcos H. Woehrmann 2014-07-25 11:20:05 UTC
Other PDF readers (mupdf, Apple Preview, Adobe Acrobat) open the file correctly.
Comment 2 Ray Johnston 2014-07-25 14:49:01 UTC
Did you check Ghostscript "commercial build" with Luratech decoder?
Comment 3 Ray Johnston 2014-07-25 14:49:54 UTC
oops. Please disregard last comment. I hadn't read carefully :-(
Comment 4 Henry Stiles 2014-07-29 19:54:31 UTC
Copying Ken as the file appears to have font problems as well.
Comment 5 Ken Sharp 2014-07-30 00:27:23 UTC
(In reply to Henry Stiles from comment #4)
> Copying Ken as the file appears to have font problems as well.

How can you tell ? All I see is a mess..... If I remove the image from the content stream then I get a blank page in both Acrobat and Ghostscript. What are you seeing Henry ?

And surely if its fonts then it should be Chris that gets copied ?
Comment 6 Ken Sharp 2014-07-30 00:32:39 UTC
On inspecting the page content stream, it appears that the majority (possibly *all*) the text is drawn with Text rendering mode 3 (neither stroke nor fill). This is usually done so that an image can be 'searched'.

Ghostscript doesn't do anything with Tr mode 3 so I'm at a loss to see what the problem could be.
Comment 7 Henry Stiles 2014-08-14 12:47:47 UTC
Some progress here: the reading part of the filter is correct, it is set up to read the correct amount of data, the graphics library image is set up wrong.  The image uses bits per component from the image dictionary which isn't right according to specification.  So the input tries to read 8 bpc data and it is written to an image that expect 4 bpc, and the image signals all done 1/2 way through the data as expected.  I'm surprised this is broken, at least I'd expect both input and output to be wrong.
Comment 8 Ken Sharp 2014-08-18 02:11:23 UTC
commit db7668753ca114aabc4d34063876732dc043e9b8 fixes this for me.

Strangely it causes some of the cluster machines to throw seg faults or errors when processing a particular EPS file (Bug688845.eps) which cannot possibly be affected by this change. I'm also unable to reproduce a problem locally either on Windows or Linux.....
Comment 9 Ken Sharp 2014-08-18 02:23:38 UTC
I'm reassigning this one to Marcos for now, in the hope that he can identify some means to reproduce the seg fault caused by this commit.
Comment 10 Marcos H. Woehrmann 2014-10-19 19:15:27 UTC
(In reply to Ken Sharp from comment #8)
> commit db7668753ca114aabc4d34063876732dc043e9b8 fixes this for me.
> 
> Strangely it causes some of the cluster machines to throw seg faults or
> errors when processing a particular EPS file (Bug688845.eps) which cannot
> possibly be affected by this change. I'm also unable to reproduce a problem
> locally either on Windows or Linux.....

I don't believe the seg faults in the regression tests with Bug688845.eps are related to this commit either; I see seg faults in the regression logs starting in May.  

If I can reproduce the seg faults reliably or find a valgrind error I'll open a separate bug.
Comment 11 Marcos H. Woehrmann 2014-10-19 19:28:15 UTC
(In reply to Marcos H. Woehrmann from comment #10)
> (In reply to Ken Sharp from comment #8)
> > commit db7668753ca114aabc4d34063876732dc043e9b8 fixes this for me.
> > 
> > Strangely it causes some of the cluster machines to throw seg faults or
> > errors when processing a particular EPS file (Bug688845.eps) which cannot
> > possibly be affected by this change. I'm also unable to reproduce a problem
> > locally either on Windows or Linux.....
> 
> I don't believe the seg faults in the regression tests with Bug688845.eps
> are related to this commit either; I see seg faults in the regression logs
> starting in May.  
> 
> If I can reproduce the seg faults reliably or find a valgrind error I'll
> open a separate bug.

Turns out there already is an open bug: Bug 694549