Package com.twelvemonkeys.servlet.image
Class CropFilter
- java.lang.Object
-
- com.twelvemonkeys.servlet.GenericFilter
-
- com.twelvemonkeys.servlet.image.ImageFilter
-
- com.twelvemonkeys.servlet.image.ScaleFilter
-
- com.twelvemonkeys.servlet.image.CropFilter
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Filter
,javax.servlet.FilterConfig
@Deprecated public class CropFilter extends ScaleFilter
Deprecated.This Servlet is able to render a cropped part of an image.
Parameters:
cropX
- integer, the new left edge of the image.
cropY
- integer, the new top of the image.
cropWidth
- integer, the new width of the image.
cropHeight
- integer, the new height of the image.
cropUniform
- boolean, wether or not uniform scalnig should be used. Default is
true
. cropUnits
- string, one of
PIXELS
,PERCENT
.PIXELS
is default. image
- string, the URL of the image to scale.
scaleX
- integer, the new width of the image.
scaleY
- integer, the new height of the image.
scaleUniform
- boolean, wether or not uniform scalnig should be used. Default is
true
. scaleUnits
- string, one of
PIXELS
,PERCENT
.PIXELS
is default. scaleQuality
- string, one of
SCALE_SMOOTH
,SCALE_FAST
,SCALE_REPLICATE
,SCALE_AREA_AVERAGING
.SCALE_DEFAULT
is default.
Examples:
<IMG src="/crop/test.jpg?image=http://www.iconmedialab.com/images/random/home_image_12.jpg&cropWidth=500&cropUniform=true">
<IMG src="/crop/test.png?cache=false&image=http://www.iconmedialab.com/images/random/home_image_12.jpg&cropWidth=50&cropUnits=PERCENT">- Version:
- $Id: CropFilter.java#1 $
- Author:
- Harald Kuhr, last modified by $Author: haku $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
PARAM_CROP_HEIGHT
Deprecated.cropHeight
protected static java.lang.String
PARAM_CROP_UNIFORM
Deprecated.cropUniform
protected static java.lang.String
PARAM_CROP_UNITS
Deprecated.cropUnits
protected static java.lang.String
PARAM_CROP_WIDTH
Deprecated.cropWidth
protected static java.lang.String
PARAM_CROP_X
Deprecated.cropX
protected static java.lang.String
PARAM_CROP_Y
Deprecated.cropY
-
Fields inherited from class com.twelvemonkeys.servlet.image.ScaleFilter
defaultScaleQuality, PARAM_IMAGE, PARAM_SCALE_QUALITY, PARAM_SCALE_UNIFORM, PARAM_SCALE_UNITS, PARAM_SCALE_X, PARAM_SCALE_Y, UNITS_PERCENT, UNITS_PIXELS, UNITS_UNKNOWN
-
Fields inherited from class com.twelvemonkeys.servlet.image.ImageFilter
triggerParams
-
Fields inherited from class com.twelvemonkeys.servlet.GenericFilter
oncePerRequest
-
-
Constructor Summary
Constructors Constructor Description CropFilter()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.awt.image.RenderedImage
doFilter(java.awt.image.BufferedImage pImage, javax.servlet.ServletRequest pRequest, ImageServletResponse pResponse)
Deprecated.Reads the image from the requested URL, scales it, crops it, and returns it in the Servlet stream.protected java.awt.Rectangle
getBounds(int pX, int pY, int pWidth, int pHeight, int pUnits, boolean pUniform, java.awt.image.BufferedImage pImg)
Deprecated.-
Methods inherited from class com.twelvemonkeys.servlet.image.ScaleFilter
getDimensions, getQuality, getUnits, setDefaultScaleQuality
-
Methods inherited from class com.twelvemonkeys.servlet.image.ImageFilter
doFilterImpl, setTriggerParams, trigger
-
Methods inherited from class com.twelvemonkeys.servlet.GenericFilter
destroy, doFilter, getFilterConfig, getFilterName, getInitParameter, getInitParameterNames, getServletContext, init, init, log, log, setFilterConfig, setOncePerRequest
-
-
-
-
Field Detail
-
PARAM_CROP_X
protected static final java.lang.String PARAM_CROP_X
Deprecated.cropX
- See Also:
- Constant Field Values
-
PARAM_CROP_Y
protected static final java.lang.String PARAM_CROP_Y
Deprecated.cropY
- See Also:
- Constant Field Values
-
PARAM_CROP_WIDTH
protected static final java.lang.String PARAM_CROP_WIDTH
Deprecated.cropWidth
- See Also:
- Constant Field Values
-
PARAM_CROP_HEIGHT
protected static final java.lang.String PARAM_CROP_HEIGHT
Deprecated.cropHeight
- See Also:
- Constant Field Values
-
PARAM_CROP_UNIFORM
protected static final java.lang.String PARAM_CROP_UNIFORM
Deprecated.cropUniform
- See Also:
- Constant Field Values
-
PARAM_CROP_UNITS
protected static final java.lang.String PARAM_CROP_UNITS
Deprecated.cropUnits
- See Also:
- Constant Field Values
-
-
Method Detail
-
doFilter
protected java.awt.image.RenderedImage doFilter(java.awt.image.BufferedImage pImage, javax.servlet.ServletRequest pRequest, ImageServletResponse pResponse)
Deprecated.Reads the image from the requested URL, scales it, crops it, and returns it in the Servlet stream. See above for details on parameters.- Overrides:
doFilter
in classScaleFilter
- Parameters:
pImage
- the image to filterpRequest
- the servlet requestpResponse
- the servlet response- Returns:
- the filtered image
-
getBounds
protected java.awt.Rectangle getBounds(int pX, int pY, int pWidth, int pHeight, int pUnits, boolean pUniform, java.awt.image.BufferedImage pImg)
Deprecated.
-
-