fedora.localservices.imagemanip
Class ImageManipulation
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
fedora.localservices.imagemanip.ImageManipulation
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public class ImageManipulation
- extends javax.servlet.http.HttpServlet
ImageManipulation is a Java servlet that takes a URL of an image as a param
and based on other given parameters, can perform a variety of image related
manipulations on the object. After the image is manipulated, it is then
sent back as an image/type object to the calling parent, most often a
browser or an HTML img tag.
- Version:
- $Id: ImageManipulation.java 5286 2006-12-03 06:04:44Z cwilper $
- Author:
- Theodore Serbinski, tss24@cornell.edu
- See Also:
- Serialized Form
|
Method Summary |
ij.process.ImageProcessor |
crop(ij.process.ImageProcessor ip,
java.lang.String cropX,
java.lang.String cropY,
java.lang.String cropWidth,
java.lang.String cropHeight)
Crops an image with supplied starting point and ending point. |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Method automatically called by browser to handle image manipulations. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ImageManipulation
public ImageManipulation()
doGet
public void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
- Method automatically called by browser to handle image manipulations.
- Overrides:
doGet in class javax.servlet.http.HttpServlet
- Parameters:
req - Browser request to servlet
res Response sent back to browser after image manipulation
- Throws:
java.io.IOException - If an input or output exception occurred
ServletException If a servlet exception occurred
javax.servlet.ServletException
crop
public ij.process.ImageProcessor crop(ij.process.ImageProcessor ip,
java.lang.String cropX,
java.lang.String cropY,
java.lang.String cropWidth,
java.lang.String cropHeight)
- Crops an image with supplied starting point and ending point.
- Parameters:
ip - The image to crop
cropX The starting x position; x=0 corresponds to left side of image
cropY The starting y position; y=0 corresponds to top of image
cropWidth The width of the crop, starting from the above x
cropHeight The height of the crop, starting from the above y
- Returns:
- The image cropped