Bug 692225

Summary: /Interpolate and /Decode are misbehaving in --image--
Product: Ghostscript Reporter: François Robert <frobert>
Component: PS InterpreterAssignee: Robin Watts <robin.watts>
Status: RESOLVED FIXED    
Severity: major CC: henry.stiles
Priority: P4    
Version: 9.02   
Hardware: PC   
OS: Windows XP   
Customer: Word Size: ---

Description François Robert 2011-05-24 10:47:49 UTC
This bug was found when testing a separation procset. I use /Decode [1 1] for producing a white knockout effect. However, when /Interpolate is true, /Decode is ignored and non white pixels are displayed.

Here is a simple test case:
0.4 setgray
0 0 200 200 rectfill
50 50 translate
/DeviceGray setcolorspace
100 100 scale
<< 
/Interpolate true
/ImageType 1
/Width 8
/Height 8
/BitsPerComponent 8
/Decode [1 1]
/ImageMatrix [8 0 0 -8 0 8] 
/DataSource <AA5500>
>> image

When /Interpolate is false, it renders a white square in the middle of a gray square (as expected). When /Interpolate is true, it renders a blurred checkered square in the middle of the gray square. This is unexpected...
Comment 1 Robin Watts 2011-05-30 19:32:55 UTC
Thanks for this report. Fixed in git commit 91b9580.

The problem appears to be simply that in one branch of a nested if, we forgot to check if the Decode array was the default and just assumed it.