public class ImageHelper extends Object implements ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
ImageHelper(PictureUploadPolicy uploadPolicy,
PictureFileData pictureFileData,
int targetMaxWidth,
int targetMaxHeight,
int quarterRotation)
Standard constructor.
|
| Modifier and Type | Method and Description |
|---|---|
BufferedImage |
getBufferedImage(boolean highquality,
BufferedImage sourceBufferedImage)
This function resizes the picture, if necessary, according to the maxWidth and maxHeight, given to the
ImageHelper constructor.
|
boolean |
hasToTransformPicture()
This function indicate if the picture has to be modified.
|
boolean |
imageUpdate(Image img,
int infoflags,
int x,
int y,
int width,
int height)
Implementation of the ImageObserver interface.
|
public ImageHelper(PictureUploadPolicy uploadPolicy, PictureFileData pictureFileData, int targetMaxWidth, int targetMaxHeight, int quarterRotation) throws JUploadIOException
uploadPolicy - The current upload policypictureFileData - The picture file data to helptargetMaxWidth - targetMaxHeight - quarterRotation - Current quarter rotation (from 0 to 3)JUploadIOExceptionpublic boolean hasToTransformPicture()
throws JUploadException
JUploadException - Contains any exception that could be thrown in this methodpublic BufferedImage getBufferedImage(boolean highquality, BufferedImage sourceBufferedImage) throws JUploadException
highquality - (added by David Gnedt): if set to true, the BufferedImage.getScaledInstance() is called. This
generates better image, but consumes more CPU.sourceBufferedImage - The image to resize or rotate or both or no tranformation...JUploadException - Contains any exception thrown from within this method.public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
imageUpdate in interface ImageObserverimg - infoflags - x - y - width - height - Copyright © 2015. All rights reserved.