private void applyAndVerify(String fname, Transform transform, ChkType chkType, OutputEncoding outType) throws IOException {
int expectedWidth = -1;
int expectedHeight = -1;
Image image = readImage(fname);
if (chkType == ChkType.FLIP) {
expectedWidth = image.getWidth();
expectedHeight = image.getHeight();
} else if (chkType == ChkType.ROTATE) {
expectedWidth = image.getHeight();
expectedHeight = image.getWidth();
} else if (chkType == ChkType.CROP) {
expectedWidth = image.getWidth() / 2;
expectedHeight = image.getHeight() / 2;
}
Image transImg = imagesService.applyTransform(transform, image, outType);
assertEquals(expectedWidth, transImg.getWidth());
assertEquals(expectedHeight, transImg.getHeight());
}