public class ImageResizeUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static org.slf4j.Logger |
logger |
| 构造器和说明 |
|---|
ImageResizeUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
resize(BufferedImage sourceImage,
int scaledWidth,
int scaledHeight,
File targetFile,
String formatName)
图片分辨率压缩
|
static boolean |
resize(File sourceFile,
File targetFile,
int scaledWidth,
int scaledHeight)
图片分辨率压缩
|
static File |
resizeHeight(File sourceFile,
int scaledHeight)
图片分辨率压缩
|
static File |
resizeWidth(File sourceFile,
int scaledWidth)
图片分辨率压缩
|
public static File resizeWidth(File sourceFile, int scaledWidth)
sourceFile - 源图片scaledWidth - 目标宽IOExceptionpublic static File resizeHeight(File sourceFile, int scaledHeight)
sourceFile - 源图片scaledHeight - 目标高IOExceptionpublic static boolean resize(File sourceFile, File targetFile, int scaledWidth, int scaledHeight)
sourceFile - 源图片targetFile - 结果图片scaledWidth - 目标宽scaledHeight - 目标高IOExceptionpublic static boolean resize(BufferedImage sourceImage, int scaledWidth, int scaledHeight, File targetFile, String formatName)
sourceImage - 源图片scaledWidth - 目标宽scaledHeight - 目标高targetFile - 结果图片 为空则会生成临时文件formatName - 目标格式( jpeg / png )IOExceptionCopyright © 2025. All rights reserved.