/** * Returns the value of index 0 of a given tag as a * long. The caller is responsible for ensuring that the tag is * present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED, * TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG. */ public long getFieldAsLong(int tag) { return getFieldAsLong(tag, 0); }
throw new SubImageNotFoundException(errorMessage); int width = (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_IMAGE_WIDTH); int height = (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_IMAGE_LENGTH); ImageSize size = new ImageSize(); size.setSizeInPixels(width, height); int unit = 2; //inch is default if (dir.isTagPresent(TIFFImageDecoder.TIFF_RESOLUTION_UNIT)) { unit = (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_RESOLUTION_UNIT);
(int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_IMAGE_WIDTH), (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_IMAGE_LENGTH)); (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_TILE_WIDTH); tileHeight = (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_TILE_LENGTH); tileOffsets = (dir.getField(TIFFImageDecoder.TIFF_TILE_OFFSETS)).getAsLongs(); ? (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_TILE_WIDTH) : bounds.width; TIFFField field = ? (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_TILE_LENGTH) : bounds.height; } else {