public final class ImageKit extends Object
| Constructor and Description |
|---|
ImageKit() |
| Modifier and Type | Method and Description |
|---|---|
static File |
decodeBase64(String imageBase64String,
String fileName)
将base64格式编码成文件
|
static String |
encodeBase64(File imageFile)
将文件编码成base64格式
|
static String |
encodeBase64(String imageFilePath)
将文件编码成base64格式
|
static String |
encodeDataUri(File imageFile)
生成形如data:image/jpeg;base64,iVBORw0KGgoA……的字符串,将图片文件Data URI化
|
static String |
encodeDataUri(String imageFilePath)
生成形如data:image/jpeg;base64,iVBORw0KGgoA……的字符串,将图片文件Data URI化
|
public static String encodeDataUri(String imageFilePath) throws IOException
imageFilePath - 图片文件路径IOExceptionpublic static String encodeDataUri(File imageFile) throws IOException
imageFile - 图片文件对象IOExceptionpublic static String encodeBase64(String imageFilePath) throws IOException
imageFilePath - 图片文件路径IOExceptionpublic static String encodeBase64(File imageFile) throws IOException
imageFile - 图片文件对象IOExceptionpublic static File decodeBase64(String imageBase64String, String fileName) throws IOException
imageBase64String - 已经Base64的图片文件StringfileName - 文件存储的目录及文件名IOExceptionCopyright © 2020. All rights reserved.