final TIFFDecodeParam param = new TIFFDecodeParam();
final TIFFImage img = new TIFFImage(this.seekableInput, param, 0);
final TIFFDirectory dir = (TIFFDirectory) img.getProperty(
"tiff_directory");
TIFFField fld;
fld = dir.getField(TIFFImageDecoder.TIFF_IMAGE_WIDTH);
final long pixelWidth = fld.getAsLong(0);
this.pixelWidth = (int) pixelWidth;
fld = dir.getField(TIFFImageDecoder.TIFF_IMAGE_LENGTH);
final long pixelHeight = fld.getAsLong(0);
this.pixelHeight = (int) pixelHeight;
fld = dir.getField(TIFFImageDecoder.TIFF_X_RESOLUTION);
this.xResolution = (int) fld.getAsFloat(0);
fld = dir.getField(TIFFImageDecoder.TIFF_Y_RESOLUTION);
this.yResolution = (int) fld.getAsFloat(0);
fld = dir.getField(TIFFImageDecoder.TIFF_COMPRESSION);
if (fld != null) {
this.compression = fld.getAsInt(0);
}
fld = dir.getField(TIFFImageDecoder.TIFF_BITS_PER_SAMPLE);
if (fld != null) {
final int bitDepth = fld.getAsInt(0);
this.setBitDepth(bitDepth);
}
fld = dir.getField(TIFFImageDecoder.TIFF_ROWS_PER_STRIP);
if (fld == null) {
this.stripCount = 1;
} else {
this.stripCount = (int) (dir.getFieldAsLong(
TIFFImageDecoder.TIFF_IMAGE_LENGTH)
/ fld.getAsLong(0));
}
fld = dir.getField(TIFFImageDecoder.TIFF_FILL_ORDER);
if (fld != null) {
this.fillOrder = fld.getAsInt(0);
}
this.stripOffset = dir.getField(
TIFFImageDecoder.TIFF_STRIP_OFFSETS).getAsLong(0);
this.stripLength = dir.getField(