public class ImageKit extends Object
Modifier and Type | Method and Description |
---|---|
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
- 图片文件路径IOException
public static String encodeDataUri(File imageFile) throws IOException
imageFile
- 图片文件对象IOException
public static String encodeBase64(String imageFilePath) throws IOException
imageFilePath
- 图片文件路径IOException
public static String encodeBase64(File imageFile) throws IOException
imageFile
- 图片文件对象IOException
Copyright © 2018. All rights reserved.