TMI-72: TIFFImageReader now allocates a buffer for LZW decoding same as image width.

This commit is contained in:
Harald Kuhr 2014-10-31 14:15:00 +01:00
parent 98d82fb093
commit 706b8a8631
2 changed files with 1 additions and 2 deletions

View File

@ -367,7 +367,6 @@ abstract class LZWDecoder implements Decoder {
result = 31 * result + (int) firstChar; result = 31 * result + (int) firstChar;
return result; return result;
} }
} }
} }

View File

@ -1243,7 +1243,7 @@ public class TIFFImageReader extends ImageReaderBase {
case TIFFBaseline.COMPRESSION_PACKBITS: case TIFFBaseline.COMPRESSION_PACKBITS:
return new DecoderStream(stream, new PackBitsDecoder(), 1024); return new DecoderStream(stream, new PackBitsDecoder(), 1024);
case TIFFExtension.COMPRESSION_LZW: case TIFFExtension.COMPRESSION_LZW:
return new DecoderStream(stream, LZWDecoder.create(LZWDecoder.isOldBitReversedStream(stream)), 1024); return new DecoderStream(stream, LZWDecoder.create(LZWDecoder.isOldBitReversedStream(stream)), width);
case TIFFExtension.COMPRESSION_ZLIB: case TIFFExtension.COMPRESSION_ZLIB:
// TIFFphotoshop.pdf (aka TIFF specification, supplement 2) says ZLIB (8) and DEFLATE (32946) algorithms are identical // TIFFphotoshop.pdf (aka TIFF specification, supplement 2) says ZLIB (8) and DEFLATE (32946) algorithms are identical
case TIFFExtension.COMPRESSION_DEFLATE: case TIFFExtension.COMPRESSION_DEFLATE: