Bug 692557 - ImageType 3 invisible on x11alpha
Summary: ImageType 3 invisible on x11alpha
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Graphics Library (show other bugs)
Version: master
Hardware: All All
: P2 normal
Assignee: Marcos H. Woehrmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-29 13:17 UTC by Alex Cherepanov
Modified: 2011-11-04 17:14 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Cherepanov 2011-09-29 13:17:59 UTC
Created attachment 7946 [details]
input.pdf - sample PDF file

The sample file has a null XObject resource, similar to
/Resources <</XObject <</Obj1 null >> >>

This is a correct PDF but Ghostscript expects an actual resource dictionary
and fails with PS errors.

The problem is easy to fix and a patch will be posted shortly.
Comment 1 Alex Cherepanov 2011-09-29 21:08:57 UTC
A patch that checks XObjects for null has been committed as a rev. 
63f2476edccc4860312737b61e86c929c340cb72

Unfortunately, there are rendering problems related to either to JBIG2Decode
or masked images.
Comment 2 Alex Cherepanov 2011-09-29 21:11:12 UTC
Created attachment 7950 [details]
Simplified sample file.

This sample file has only a masked image, null XObject has been removed.
The file looks OK in AR9 but blank on gs.
Comment 3 Alex Cherepanov 2011-10-03 03:06:37 UTC
Created attachment 7958 [details]
A little more simplified file.

This file has a masked image only. Further simplification is not possible.
Both the base image and the mask are rendered OK by Ghostscript when they
are not combined into a masked image.

The problem appears to be a regression. V. 9.02 renders the simplified file
correctly, but v. 9.04 doesn't.
Comment 4 Alex Cherepanov 2011-10-11 04:19:01 UTC
Created attachment 7979 [details]
sample.tar.bz2 - PS sample

This is simple PS program that exercises a Type 3 masked image.
Surprisingly, it doesn't work on any version of Ghostscript.
Comment 5 Alex Cherepanov 2011-10-11 04:26:29 UTC
My previous comment is not correct.
v. 9.01 and 9.02 render the file correctly.
v. 8.64..9.00 and v 9.04..HEAD render the file incorrectly
Comment 6 Alex Cherepanov 2011-10-13 03:52:42 UTC
The strange re-appearance pattern of this bug is caused by the choice
of the default device in different versions. x11 device works in all recent
versions, x11alpha doesn't.

I'm reassigning this bug to Michael as an x11alpha problem.
Comment 7 Alex Cherepanov 2011-10-30 06:58:28 UTC
The bug is still reproducible.
Comment 8 Marcos H. Woehrmann 2011-11-01 16:26:49 UTC
Here is the command line from the customer's original email:

Gswin32.exe -q -dBATCH -dNOPAUSE -r144x144 -dTextAlphaBits=4 -dGraphicAlphaBits=4 -dFirstPage=1 -dLastPage=1 -dPrinted=false -sDEVICE=png16m -dPDFIgnoreAnnots=true -I -sOutputFile="C:\%d.png" "C:\BeforeImportTopdfDocs.pdf"
Comment 9 Michael Vrhel 2011-11-01 16:59:59 UTC
With that command line, the file looks fine to me.  What exactly is the issue?
Comment 10 Michael Vrhel 2011-11-01 17:05:11 UTC
Assigning back to support for clarification as to the exact issue.
Comment 11 Marcos H. Woehrmann 2011-11-04 03:21:34 UTC
I've sent the customer an output png file to confirm that it is correct and the patch referenced in comment #1.  Assuming the customer is satisfied I'll close this bug and reopen one for the remaining x11alpha issue.
Comment 12 Marcos H. Woehrmann 2011-11-04 17:14:48 UTC
The customer confirms that the patch from comment #1 fixes the problem.  I'm closing this bug and will open a new one for the x11alpha issue.