File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
common-core/src/main/java/com/yz/common/core/utils Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public class ImageUtil {
1515 * @param imgFile
1616 * @return
1717 */
18- public String imageToBase64 (File imgFile ) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
18+ public static String imageToBase64 (File imgFile ) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
1919 String contentToBase64 = FileUtils .fileContentToBase64 (imgFile );
2020 String name = imgFile .getName ();
2121 String suffix = name .substring (name .lastIndexOf ("." ) + 1 );
@@ -28,7 +28,7 @@ public String imageToBase64(File imgFile) {// 将图片文件转化为字节数
2828 * @param imgFilePath 图片本地路径
2929 * @return
3030 */
31- public String imageToBase64 (String imgFilePath ) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
31+ public static String imageToBase64 (String imgFilePath ) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
3232 File file = new File (imgFilePath );
3333 return imageToBase64 (file );
3434 }
You can’t perform that action at this time.
0 commit comments