public class ImageUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PIXEL_DPI |
Constructor and Description |
---|
ImageUtils() |
Modifier and Type | Method and Description |
---|---|
static Dimension |
getImageDimension(InputStream is,
int type)
Return the dimension of this image
|
static int[] |
getResolution(ImageReader r)
The metadata of PNG and JPEG can contain the width of a pixel in millimeters.
|
public static final int PIXEL_DPI
public static Dimension getImageDimension(InputStream is, int type)
is
- the stream containing the image datatype
- type of the picture: Workbook.PICTURE_TYPE_JPEG
,
Workbook.PICTURE_TYPE_PNG
or Workbook.PICTURE_TYPE_DIB
public static int[] getResolution(ImageReader r) throws IOException
25.4/HorizontalPixelSize
and 25.4/VerticalPixelSize
. Where 25.4 is the number of mm in inch.{horisontalPdi, verticalDpi}
.
{96, 96} is the default.IOException
Copyright © 2020. All rights reserved.