// Rescale the image
image = RescaleImage(image, width.intValue(), height.intValue());
mOutput.write(image);
} catch (PipeIOException e) {
throw new ActivityPipeProcessingException(e);
} catch (PipeTerminatedException e) {
throw new ActivityTerminatedException();
} catch (IOException e) {
throw new ActivityProcessingException(e);
} catch (PipeClosedException e) {