mirror of
https://github.com/dromara/tianai-captcha.git
synced 2026-05-07 06:04:34 +08:00
更改NAN bug
This commit is contained in:
@@ -182,7 +182,8 @@ public class SliderCaptchaTemplate {
|
||||
* @return true 成功 false 失败
|
||||
*/
|
||||
public boolean percentageContrast(Float newPercentage, Float oriPercentage) {
|
||||
if (newPercentage == null || Float.isNaN(newPercentage) || oriPercentage == null || Float.isNaN(oriPercentage)) {
|
||||
if (newPercentage == null || Float.isNaN(newPercentage) || Float.isInfinite(newPercentage)
|
||||
|| oriPercentage == null || Float.isNaN(oriPercentage) || Float.isInfinite(oriPercentage)) {
|
||||
return false;
|
||||
}
|
||||
BigDecimal num = BigDecimal.valueOf(0.02d);
|
||||
@@ -198,6 +199,7 @@ public class SliderCaptchaTemplate {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private String transformBase64(BufferedImage bufferedImage, String formatName) {
|
||||
byte[] data = null;
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||
|
||||
Reference in New Issue
Block a user