}
public Dimension getImageSize(ByteSource byteSource, Map params)
throws ImageReadException, IOException
{
FormatCompliance formatCompliance = FormatCompliance.getDefault();
TiffContents contents = new TiffReader(isStrict(params))
.readFirstDirectory(byteSource, params, false, formatCompliance);
TiffDirectory directory = (TiffDirectory) contents.directories.get(0);
int width = directory.findField(TIFF_TAG_IMAGE_WIDTH).getIntValue();