public final class ImageUtils
extends java.lang.Object
Constructor and Description |
---|
ImageUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
getHeight(java.io.File image)
Return image height in pixels.
|
static void |
setDPI(java.io.File image)
Set the DPI on
image to 160. |
static void |
setDPI(java.io.File image,
int dotsPerInch)
Set the DPI on
image to dotsPerInch . |
static void |
setSafeDpi(java.io.File image,
int maxHeightInInches)
Set the DPI on
image so that it fits in maxHeightInInches ,
or to 160 if short enough. |
public static int getHeight(java.io.File image) throws java.io.IOException
image
- image file.java.io.IOException
- Failed to read the image.public static void setSafeDpi(java.io.File image, int maxHeightInInches) throws java.io.IOException
image
so that it fits in maxHeightInInches
,
or to 160 if short enough.image
- PNG image file.maxHeightInInches
- maximum available image height in inches.java.io.IOException
- Failed to save the image.public static void setDPI(java.io.File image) throws java.io.IOException
image
to 160.image
- PNG image file.java.io.IOException
- Failed to save the image.public static void setDPI(java.io.File image, int dotsPerInch) throws java.io.IOException
image
to dotsPerInch
.image
- PNG image file.dotsPerInch
- DPI to set in metadata.java.io.IOException
- Failed to save the image.