@Override
public Object decode(InputStream inputStream) throws Exception {
ImageDecoder decoder = getDecoder(inputStream);
RenderedImage ri = null;
try {
ri = decoder.decodeAsRenderedImage();
} catch (IOException ioe){
WPSException wpse = new WPSException("Unable to decode the image. Expected an image having mimetype = " + mimeType);
wpse.initCause(ioe);
throw wpse;
}