float scale = ImageStyleUtils.getScale(originalWidth, originalHeight, style);
int scaledWidth = (int) Math.round(originalWidth * scale) - (int) ImageStyleUtils.getCropX(Math.round(originalWidth * scale), Math.round(originalHeight * scale), style);
int scaledHeight = (int) Math.round(originalHeight * scale) - (int) ImageStyleUtils.getCropY(Math.round(originalWidth * scale), Math.round(originalHeight * scale), style);
// Load the image from the given input stream
seekableInputStream = new FileCacheSeekableStream(response.getEntity().getContent());
RenderedOp image = JAI.create("stream", seekableInputStream);
if (image == null)
throw new IOException("Error reading image from input stream");
// Get the original image size