Created attachment 7334 [details] Postscript program that creates the error (see stdout) Under some circumstances LZWEncode produces one too many bytes and the resultant string causes an ioerror when decoded. See attached program example.
Apologies... The attached program shortens the encoded sting by one byte to show that the sting can be decoded by Ghostscript. The line: /lzw lzw_encode_buffer 0 img# 1 sub getinterval def % the LZW encoded string should read: /lzw lzw_encode_buffer 0 img# getinterval def % the LZW encoded string to demonstrate the ioerror in Ghostscript. P.
*** Bug 692307 has been marked as a duplicate of this bug. ***
See Bug #692307. Its not clear that the problem with the LZWEncode filter is as simple as producing an extra byte. The bitmap encoded in the 's' glyph in the output of ps2write causes an ioerror when run through other rips, but it is not cured by removing one byte of data. Raising the prioirity of this as ps2write makes extensive use of teh LZWEncode filter, and we really need this to work correctly. This may also now be a customer issue.
Created attachment 7866 [details] patch I think, the code size should be incremented writing the last code but I cannot find a good description of LZW algorithm. The description in the TIFF manual is the best I found but it is too informal.
The patch has been committed as a rev. 42582272f2b4dce1ccd5c600a2d6dc71794b4d3e
*** Bug 692386 has been marked as a duplicate of this bug. ***