{
static public void validate(PDImageXObject ximage, int bpc, int width, int height, String format, String colorSpaceName) throws IOException
{
// check the dictionary
assertNotNull(ximage);
COSStream cosStream = ximage.getCOSStream();
assertNotNull(cosStream);
assertEquals(COSName.XOBJECT, cosStream.getItem(COSName.TYPE));
assertEquals(COSName.IMAGE, cosStream.getItem(COSName.SUBTYPE));
assertTrue(ximage.getCOSStream().getFilteredLength() > 0);
assertEquals(bpc, ximage.getBitsPerComponent());
assertEquals(width, ximage.getWidth());
assertEquals(height, ximage.getHeight());
assertEquals(format, ximage.getSuffix());