Bug 692225 - /Interpolate and /Decode are misbehaving in --image--
Summary: /Interpolate and /Decode are misbehaving in --image--
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: 9.02
Hardware: PC Windows XP
: P4 major
Assignee: Robin Watts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-24 10:47 UTC by François Robert
Modified: 2011-05-30 19:32 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.