|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.studio.jira.web.util.ImageUtils
public final class ImageUtils
Utilities for resizing and cropping images
Method Summary | |
---|---|
static BufferedImage |
boxCropImage(BufferedImage image,
int sideLength)
Takes an image and returns a square image of size sizeLength
If the image is larger then the specified sizeLength then the image
is scaled down to the closest size and then cropped. |
static BufferedImage |
scaleImage(BufferedImage image,
int width,
int height)
Scales an image to the specified width and height . |
static BufferedImage |
scaleImageToMaxHeight(BufferedImage image,
int maxHeight)
Scales an image down to the specified maxHeight . |
static BufferedImage |
scaleImageToMaxWidth(BufferedImage image,
int maxWidth)
Scales an image down to the specified maxWidth . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static BufferedImage scaleImageToMaxHeight(BufferedImage image, int maxHeight)
maxHeight
.
If the image height is smaller than the maxHeight
then the original
image is returned. If the maxHeight is larger then the image height then the
width is scaled down to the ratio of the image height and maxHeight
image
- the image scalemaxHeight
- the maximum height for the image.
public static BufferedImage scaleImageToMaxWidth(BufferedImage image, int maxWidth)
maxWidth
.
If the image width is smaller than the maxWidth
then the original
image is returned. If the maxWidth is larger then the image width then the
height is scaled down to the ratio of the image width and maxWidth
image
- the image to scalemaxWidth
- the maximum width for the image
public static BufferedImage scaleImage(BufferedImage image, int width, int height)
width
and height
.
If the width of the image and height of the image are smaller then the ones specified
then the original image is returned.
If one side of the image is smaller then the scale size then the orignal size is preserved.
image
- the image to scalewidth
- the width to scale the image toheight
- the height to scale the image to.
public static BufferedImage boxCropImage(BufferedImage image, int sideLength)
sizeLength
If the image is larger then the specified sizeLength
then the image
is scaled down to the closest size and then cropped.
If a side of the image
is smaller then sideLength
then
the sideLength
will be ignored and the original size is preserved.
image
- the image to cropsideLength
- the size of square that you want the image to be.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |