public final class ImageResolverHelper extends Object
Modifier | Constructor and Description |
---|---|
private |
ImageResolverHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
resolveImageAsBase64(InputStream dataIs,
String mimeType,
int height,
int width,
int maxHeight,
int maxWidth)
Get an image's bytes encoded as base64, optionally resized.
|
static String |
resolveImageAsBase64(InputStream dataIs,
String mimeType,
int height,
int width,
int maxHeight,
int maxWidth,
int cropHeight,
int cropWidth)
Get an image's bytes encoded as base64, optionally resized.
|
private ImageResolverHelper()
public static final String resolveImageAsBase64(InputStream dataIs, String mimeType, int height, int width, int maxHeight, int maxWidth) throws IOException
dataIs
- an input stream on the image bytes.mimeType
- the image mime type.height
- the specified height. Ignored if negative.width
- the specified width. Ignored if negative.maxHeight
- the maximum image height. Ignored if height or width is specified.maxWidth
- the maximum image width. Ignored if height or width is specified.IOException
- if an error occurs.public static final String resolveImageAsBase64(InputStream dataIs, String mimeType, int height, int width, int maxHeight, int maxWidth, int cropHeight, int cropWidth) throws IOException
dataIs
- an input stream on the image bytes.mimeType
- the image mime type.height
- the specified height. Ignored if 0.width
- the specified width. Ignored if 0.maxHeight
- the maximum image height. Ignored if height or width is specified.maxWidth
- the maximum image width. Ignored if height or width is specified.cropHeight
- the cropping height. Ignored if 0.cropWidth
- the cropping width. Ignored if 0.IOException
- if an error occurs.