Download and crop an image direct from a servlet

This blog is a demonstration on how to download an image and crop them directly just before the servlet writes the image into the response. This is useful in instances where you don't want the downloaded image saved before they are consumed.

The following is that servlet, it takes two parameters, the url of the image, and the image type. Add parameters as your application may require. Please refer to the inline comments for more information.