File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -585,8 +585,11 @@ public static BufferedImage flipVertical(Object srcIm, File tarIm) {
585
585
* @return 被扭曲后的图片
586
586
*/
587
587
public static BufferedImage twist (Object srcIm , double twistRank , String bgColor ) {
588
+ if (twistRank <= 0 ) {
589
+ twistRank = 1 ;
590
+ }
588
591
BufferedImage bufImg = read (srcIm );
589
- double period = R .random (0 , 7 ) + 3 ;// 波形的幅度倍数,越大扭曲的程序越高,一般为3
592
+ double period = R .random (0 , 10 ) + 3 ;// 波形的幅度倍数,越大扭曲的程序越高,一般为3
590
593
double phase = R .random (0 , 6 );// 波形的起始相位,取值区间(0-2*PI)
591
594
int width = bufImg .getWidth ();
592
595
int height = bufImg .getHeight ();
@@ -1454,7 +1457,7 @@ public static BufferedImage createCaptcha(String content,
1454
1457
}
1455
1458
1456
1459
// 图像扭曲
1457
-
1460
+ im = twist ( im , 1 , bgColor );
1458
1461
return im ;
1459
1462
}
1460
1463
You can’t perform that action at this time.
0 commit comments