public class ThumbnailUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
OPTIONS_RECYCLE_INPUT
Constant used to indicate we should recycle the input in
extractThumbnail(Bitmap, int, int, int) unless the output is the input. |
static int |
TARGET_SIZE_MICRO_THUMBNAIL
Constant used to indicate the dimension of micro thumbnail.
|
static int |
TARGET_SIZE_MINI_THUMBNAIL
Constant used to indicate the dimension of mini thumbnail.
|
Constructor and Description |
---|
ThumbnailUtils() |
Modifier and Type | Method and Description |
---|---|
static Bitmap |
createImageThumbnail(String filePath,
int kind)
This method first examines if the thumbnail embedded in EXIF is bigger than our target
size.
|
static Bitmap |
createVideoThumbnail(String filePath,
int kind)
Create a video thumbnail for a video.
|
static Bitmap |
extractThumbnail(Bitmap source,
int width,
int height)
Creates a centered bitmap of the desired size.
|
static Bitmap |
extractThumbnail(Bitmap source,
int width,
int height,
int options)
Creates a centered bitmap of the desired size.
|
public static final int OPTIONS_RECYCLE_INPUT
extractThumbnail(Bitmap, int, int, int)
unless the output is the input.public static final int TARGET_SIZE_MINI_THUMBNAIL
public static final int TARGET_SIZE_MICRO_THUMBNAIL
public static Bitmap createImageThumbnail(String filePath, int kind)
filePath
- the path of image filekind
- could be MINI_KIND or MICRO_KINDpublic static Bitmap createVideoThumbnail(String filePath, int kind)
filePath
- the path of video filekind
- could be MINI_KIND or MICRO_KINDpublic static Bitmap extractThumbnail(Bitmap source, int width, int height)
source
- original bitmap sourcewidth
- targeted widthheight
- targeted height