Bug 689889 - Image mask DataSource String no resused.
Summary: Image mask DataSource String no resused.
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: master
Hardware: All All
: P2 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks: 689246
  Show dependency tree
 
Reported: 2008-06-10 13:33 UTC by Michael Vrhel
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer: 330
Word Size: ---


Attachments
imagemask-with-pattern.ps (583 bytes, application/postscript)
2008-06-10 19:49 UTC, Michael Vrhel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Vrhel 2008-06-10 13:33:30 UTC
For the case of an Imagemask (in fact any imaging operator),  the interpreter
should reuse the string as needed to satisfy the imaging operation.  ( see page
291 of PLRM).    The attached example contains only 2 bytes of data, but the
imaging operation is expecting much more.  For the attached example, the stream
passes on the EOFC to the simscale.c filter (when you have -dDOINTERPOLATE).  
With a fix for bug 689888, this causes the filter to pass the EOFC on, which
will  make the ImageMask not to appear.  A solution would be to wrap the sting
data into a procedure when dealing with imaging operators, since the data should
be repeatedly read.  For the attached example,  /DataSource <00FF> becomes 
/DataSource { <00FF> }.  Thanks to Ray for stepping me through this.
Comment 1 Alex Cherepanov 2008-06-10 19:13:47 UTC
Please attach the sample file.
Comment 2 Michael Vrhel 2008-06-10 19:49:36 UTC
Created attachment 4089 [details]
imagemask-with-pattern.ps

In the file, changing /DataSource <00FF> to /DataSource {<00FF>} solves the
issue.	Sorry I forgot to attached it earlier.
Comment 3 Michael Vrhel 2008-06-21 04:11:16 UTC
The image interpolation in the source color space can not be properly tested
until this but is fixed.
Comment 4 Michael Vrhel 2008-07-01 05:50:33 UTC
Since this bug is blocking 689246 (a P2 level bug), I am bumping this up to the
same priority.  
Comment 5 Alex Cherepanov 2008-07-21 11:59:24 UTC
Wrap string data source into a procedure when /ImscaleDecode filter is
installed, to ensure repeated reading of the string when the imagemask
needs more data than has the string.

The following patch is committed as a rev. 8854.
http://ghostscript.com/pipermail/gs-cvs/2008-July/008435.html
Regression testing shows no differences.