reader = ImageIO.getImageReadersByFormatName("wbmp").next();
}
ParameterBlockJAI pblock = new ParameterBlockJAI("ImageRead");
pblock.setParameter("Input", ImageIO.createImageInputStream(stream));
pblock.setParameter("Reader", reader);
RenderedOp image = JAI.create("ImageRead", pblock);
int expectedWidth = width;
int expectedHeight = (width > 512) ? width : 512;
assertEquals("Incorrect image width", expectedWidth, image.getWidth());
assertEquals("Incorrect image height", expectedHeight, image.getHeight());
return image;
}