TMI-77: Fixed bug in predictor for tiled TIFFs.

This commit is contained in:
Harald Kuhr 2014-11-03 21:10:36 +01:00
parent add6e07cae
commit 3c08cae093
3 changed files with 17 additions and 2 deletions

View File

@ -122,6 +122,14 @@ final class EXIFEntry extends AbstractEntry {
return "HostComputer";
case TIFF.TAG_PREDICTOR:
return "Predictor";
case TIFF.TAG_TILE_WIDTH:
return "TileWidth";
case TIFF.TAG_TILE_HEIGTH:
return "TileHeight";
case TIFF.TAG_TILE_OFFSETS:
return "TileOffsets";
case TIFF.TAG_TILE_BYTE_COUNTS:
return "TileByteCounts";
case TIFF.TAG_COPYRIGHT:
return "Copyright";
case TIFF.TAG_YCBCR_SUB_SAMPLING:

View File

@ -76,4 +76,11 @@ interface TIFFExtension {
/** For use with Photometric: 5 (Separated), when image data is in CMYK color space. */
int INKSET_CMYK = 1;
/**
* For use with Photometric: 5 (Separated), when image data is in a color space other than CMYK.
* See {@link com.twelvemonkeys.imageio.metadata.exif.TIFF#TAG_INK_NAMES InkNames} field for a
* description of the inks to be used.
*/
int INKSET_NOT_CMYK = 2;
}

View File

@ -665,8 +665,8 @@ public class TIFFImageReader extends ImageReaderBase {
? IIOUtil.createStreamAdapter(imageInput, stripTileByteCounts[i])
: IIOUtil.createStreamAdapter(imageInput);
adapter = createDecompressorStream(compression, width, adapter);
adapter = createUnpredictorStream(predictor, width, numBands, getBitsPerSample(), adapter, imageInput.getByteOrder());
adapter = createDecompressorStream(compression, stripTileWidth, adapter);
adapter = createUnpredictorStream(predictor, stripTileWidth, numBands, getBitsPerSample(), adapter, imageInput.getByteOrder());
if (interpretation == TIFFExtension.PHOTOMETRIC_YCBCR && rowRaster.getTransferType() == DataBuffer.TYPE_BYTE) {
adapter = new YCbCrUpsamplerStream(adapter, yCbCrSubsampling, yCbCrPos, colsInTile, yCbCrCoefficients);