mirror of
https://github.com/dromara/tianai-captcha.git
synced 2026-05-07 06:04:34 +08:00
U 关掉转换图片类型警告日志
This commit is contained in:
@@ -119,18 +119,18 @@ public abstract class AbstractImageCaptchaGenerator implements ImageCaptchaGener
|
||||
}
|
||||
|
||||
public String beforeTransform(BufferedImage bufferedImage, String formatType) {
|
||||
int type = bufferedImage.getType();
|
||||
if (BufferedImage.TYPE_4BYTE_ABGR == type) {
|
||||
// png , 如果转换的是jpg的话
|
||||
if (CaptchaImageUtils.isJpeg(formatType)) {
|
||||
// bufferedImage为 png, 但是转换的图片为 jpg
|
||||
if (log.isWarnEnabled()) {
|
||||
log.warn("图片验证码转换警告, 原图为 png格式时,指定转换的图片为jpg格式时可能会导致转换异常,如果转换的图片为出现错误,请设置指定转换的类型与原图的类型一致");
|
||||
} else {
|
||||
System.err.println("图片验证码转换警告, 原图为 png格式时,指定转换的图片为jpg格式时可能会导致转换异常,如果转换的图片为出现错误,请设置指定转换的类型与原图的类型一致");
|
||||
}
|
||||
}
|
||||
}
|
||||
// int type = bufferedImage.getType();
|
||||
// if (BufferedImage.TYPE_4BYTE_ABGR == type) {
|
||||
// // png , 如果转换的是jpg的话
|
||||
// if (CaptchaImageUtils.isJpeg(formatType)) {
|
||||
// // bufferedImage为 png, 但是转换的图片为 jpg
|
||||
// if (log.isWarnEnabled()) {
|
||||
// log.warn("图片验证码转换警告, 原图为 png格式时,指定转换的图片为jpg格式时可能会导致转换异常,如果转换的图片为出现错误,请设置指定转换的类型与原图的类型一致");
|
||||
// } else {
|
||||
// System.err.println("图片验证码转换警告, 原图为 png格式时,指定转换的图片为jpg格式时可能会导致转换异常,如果转换的图片为出现错误,请设置指定转换的类型与原图的类型一致");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// 其它的暂时不考虑
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user