com.atlassian.jira.lookandfeel
Class ImageScaler

java.lang.Object
  extended by com.atlassian.jira.lookandfeel.ImageScaler

public class ImageScaler
extends Object

Scales images

Since:
v4.4

Constructor Summary
ImageScaler()
           
 
Method Summary
 BufferedImage scaleImageToMaxHeight(BufferedImage image, int maxHeight)
           
 BufferedImage scaleImageToMaxWidth(BufferedImage image, int maxWidth)
           
 BufferedImage scaleImageToSquare(BufferedImage image, int maxSize, boolean crop)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageScaler

public ImageScaler()
Method Detail

scaleImageToMaxHeight

public BufferedImage scaleImageToMaxHeight(BufferedImage image,
                                           int maxHeight)
Parameters:
image - The BufferedImage you want to scale
maxHeight - The maximum height of the scaled image
Returns:
a ratio scaled BufferedImage if the height was greater than the maximum height specified, otherwise the image is unchanged

scaleImageToMaxWidth

public BufferedImage scaleImageToMaxWidth(BufferedImage image,
                                          int maxWidth)
Parameters:
image - The BufferedImage you want to scale
maxWidth - The maximum width of the scaled image
Returns:
a ratio scaled BufferedImage if the height was greater than the maximum width specified, otherwise the image is unchanged

scaleImageToSquare

public BufferedImage scaleImageToSquare(BufferedImage image,
                                        int maxSize,
                                        boolean crop)
Parameters:
image - The BufferedImage you want to scale
maxSize - The maximum edge size of the scaled image
crop - If the image is rectangular rather than square, then the image will be cropped.
Returns:
a scaled image


Copyright © 2002-2014 Atlassian. All Rights Reserved.