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