Bug 688728 - smask in pattern is black (ref 7166)
Summary: smask in pattern is black (ref 7166)
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: master
Hardware: All All
: P2 major
Assignee: Michael Vrhel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-30 07:05 UTC by Tor Andersson
Modified: 2011-09-18 21:47 UTC (History)
1 user (show)

See Also:
Customer: 700
Word Size: ---


Attachments
Much simplified testfile (6.61 KB, application/pdf)
2006-07-18 10:42 UTC, Zoltán
Details
Much simplified testfile (6.61 KB, application/pdf)
2006-07-18 10:42 UTC, Zoltán
Details
688728-simple-Illus.pdf.gz - produces correct results. (24.22 KB, application/octet-stream)
2007-04-24 14:44 UTC, Timothy Osborn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tor Andersson 2006-05-30 07:05:47 UTC
A tiled pattern composed of an image with a soft mask renders all black.
Comment 1 Tor Andersson 2006-05-30 07:06:50 UTC
Created attachment 2236 [details]
L-2.pdf
Comment 2 Zoltán 2006-07-16 23:26:42 UTC
Would I have access to customers' restricted/private test files, please?
Comment 3 Tor Andersson 2006-07-17 08:01:43 UTC
Comment on attachment 2236 [details]
L-2.pdf

I don't think this attachment contains any customer sensitive information; so I
am removing the private status.
Comment 4 Dan Coby 2006-07-18 08:24:32 UTC
Comment on attachment 2236 [details]
L-2.pdf

I am changing the attachment status back to private.  Without permission from
the customer, we should not make customer data public.
Comment 5 Zoltán 2006-07-18 10:42:05 UTC
Created attachment 2370 [details]
Much simplified testfile

Ijust the faulty object, so no more private elements are inside; moreover, it's
much easier to debug.
Comment 6 Zoltán 2006-07-18 10:42:37 UTC
Created attachment 2371 [details]
Much simplified testfile

I have insulated just the faulty object, so no more private elements are
inside; moreover, it's much easier to debug.
Comment 7 Zoltán 2006-07-19 15:03:43 UTC
The object in problem is actually an Image XObject with a soft mask, 16 0 obj 
and 15 0 obj respectively (speaking about the new, much simplified test file). 
Ghostscript simply ignores the softmask and renders the image as is, hence a 
full black image shows instead of a masked one. 
(At least as I can see, not just SMask images but no kind of PDF14 
transparencies work inside of a tiled pattern's "PaintProc" stream.)

That's because /pageusestransparency operator (see definition in pdf_main.ps) 
returns false in an undesired way (GS searches for Image XObjects with SMask 
just in resourceusestransparency and annotsusetransparency but this is not 
enough in our case) so all subsequent transparency operations are ignored.

Unfortunately forcing /pageusestransparency leave true on stack still doesn't 
solve the problem in our case. Despite of PDF14 compositor the softmask image 
is rendering as data image directly in pattern accumulator device and the 
result becames exactly the same.

Sorry, but I'm not really familiar with PDF14 compositors yet, so I simply 
can't go on from this point unless Dan lends me a helping hand for solving 
this bug...  
Comment 8 Timothy Osborn 2007-04-23 13:15:46 UTC
I reviewed this bug and everything I see indicates a problem in the PDF
interpreter component as opposed to a transparency compositing issue. Therefore
I'm moving the assignment to Alex.
Comment 9 Timothy Osborn 2007-04-23 21:18:10 UTC
I was operating under the belief that the "PDF Interpreter" is not only the lib
folder entries, but the src folder code that operates behind it. Since that has
become less clear after some deeper thought... I'm moving this bug back to my
assignment.
Comment 10 Timothy Osborn 2007-04-24 14:31:44 UTC
I have spent the better part of a day looking at this and have traced it as far
as knowing that the problem is related to the fact that the PDF interpreter code
never calls resolvecolorspace on the Pattern colorspace. As a result, the
softmask is built, but uses the wrong color space.

This was uncovered by opening the PDF in Illustrator and making a minor change
(dragged the clipping path a few pixels) and saving to a new PDF. This PDF runs
correctly and I can see that it indeed calls resolvecolorspace on the Pattern
colorspace and generates the mask correctly. 

I will post my modified PDF shortly.
Comment 11 Timothy Osborn 2007-04-24 14:44:11 UTC
Created attachment 2919 [details]
688728-simple-Illus.pdf.gz - produces correct results.

See comments above.
Comment 12 Ray Johnston 2007-12-17 12:07:55 UTC
Reassigning to new owner
Comment 13 Marcos H. Woehrmann 2008-03-11 16:30:26 UTC
Per request I'm resting this customer's bugs:  this one still occurs with r8596.
Comment 14 Ralph Giles 2008-05-14 14:14:19 UTC
Reassigning to Alex based on Tim's analysis that this is an interpreter problem.
Alex, if it really is in the graphics library, please assign to Michael.
Comment 15 Henry Stiles 2008-05-20 22:26:26 UTC
support has requested a status update for this problem.  Please add a new
comment entry or send mail to Marcos.
Comment 16 Ray Johnston 2009-02-09 11:29:22 UTC
This problem is being fixed in the SMask branch. My patch to the PDF interpreter
to find transparency in patterns installs the PDF14 compositor (properly sets
pageusestransparency) and my other fixes to the pattern accumulator to use
the pdf14 compositor when the pattern uses_transparency fix this file.
Comment 17 Michael Vrhel 2009-04-28 14:31:30 UTC
This was fixed with the soft mask merge.
Comment 18 Marcos H. Woehrmann 2011-09-18 21:47:29 UTC
Changing customer bugs that have been resolved more than a year ago to closed.