public List<ImageDataElement> getTiffRawImageDataElements() throws ImagingException {
        final TiffField tileOffsets = findField(TiffTagConstants.TIFF_TAG_TILE_OFFSETS);
        final TiffField tileByteCounts = findField(TiffTagConstants.TIFF_TAG_TILE_BYTE_COUNTS);
        final TiffField stripOffsets = findField(TiffTagConstants.TIFF_TAG_STRIP_OFFSETS);
        final TiffField stripByteCounts = findField(TiffTagConstants.TIFF_TAG_STRIP_BYTE_COUNTS);

        if (tileOffsets != null && tileByteCounts != null) {
            return getRawImageDataElements(tileOffsets, tileByteCounts);
        }
        if (stripOffsets != null && stripByteCounts != null) {
            return getRawImageDataElements(stripOffsets, stripByteCounts);
        }
        throw new ImagingException("Couldn't find image data.");
    }
Gets the image associated with the directory, if any. Note that not all directories contain images.
<p>
The optional parameters object can be used to specify image access or rendering options such as reading only a part of the overall image (i.e. reading a
sub-image) or applying a custom photometric interpreter.

@param params an object containing optional parameters to be applied to the read operation.
@return if successful, a valid BufferedImage instance.
@throws ImagingException in the event of an invalid or incompatible data format.
@throws IOException      in the event of an I/O error.
src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java