public class JaiImageProcessor extends Object implements ImageProcessor
ImageProcessor.CropRectangle, ImageProcessor.Dimensions, ImageProcessor.ImageProcessorExceptionApplication.Component.LifecycleStateMINIMUM_CROP_SIZE| Constructor and Description |
|---|
JaiImageProcessor() |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
cropAndScale(InputStream mainImageStream,
ImageProcessor.CropRectangle crop,
ImageProcessor.Dimensions limits)
Crop the main image according to this rectangle, and scale it to the
correct size for a thumbnail.
|
ImageProcessor.Dimensions |
getDimensions(InputStream imageStream)
How big is the image contained in this stream?
|
void |
shutdown(Application application)
This should be called only once, and should be the last call on this
Component.
|
void |
startup(Application application,
ComponentStartupStatus ss)
Prevent Java Advanced Imaging from complaining about the lack of
accelerator classes.
|
public void startup(Application application, ComponentStartupStatus ss)
startup in interface Application.Componentpublic void shutdown(Application application)
Application.Componentshutdown in interface Application.Componentpublic ImageProcessor.Dimensions getDimensions(InputStream imageStream) throws ImageProcessor.ImageProcessorException, IOException
ImageProcessorgetDimensions in interface ImageProcessorimageStream - The image stream. This method will not close it.ImageProcessor.ImageProcessorException - if the stream does not contain a valid image.IOException - if the stream cannot be read.public InputStream cropAndScale(InputStream mainImageStream, ImageProcessor.CropRectangle crop, ImageProcessor.Dimensions limits) throws ImageProcessor.ImageProcessorException, IOException
cropAndScale in interface ImageProcessormainImageStream - The image stream. This method will not close it.crop - x and y determine the upper left corner of the crop area.
height and width determine the size of the crop area.limits - The resulting image will be reduced as necessary to fit within
these dimensions.ImageProcessor.ImageProcessorException - If the image is smaller than the minimum crop size, or if
there is another problem cropping the image.IOException - if the image stream cannot be read.Copyright © 2016. All rights reserved.