public class ImageUtils extends Object
| Constructor and Description |
|---|
ImageUtils() |
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
scaleImage(BufferedImage image,
int maxWidth,
int maxHeight)
Return the image which resized(support JPG, PNG, GIF)
|
static InputStream |
scaleImage(BufferedImage image,
int maxWidth,
int maxHeight,
boolean crop)
Return the image which resized(support JPG, PNG, GIF)
|
public static InputStream scaleImage(BufferedImage image, int maxWidth, int maxHeight) throws Exception
image - The BufferedImage which based on InputStream
BufferedImage image = ImageIO.read(InputStream)maxWidth - Max width of thumbnail will be resizedmaxHeight - Max height of thumbnail will be resizedExceptionpublic static InputStream scaleImage(BufferedImage image, int maxWidth, int maxHeight, boolean crop) throws Exception
image - The BufferedImage which based on InputStream
BufferedImage image = ImageIO.read(InputStream)maxWidth - Max width of thumbnail will be resizedmaxHeight - Max height of thumbnail will be resizedExceptionCopyright © 2003–2019 eXo Platform SAS. All rights reserved.