Merge branch 'fix-captcha-distorts' into 'develop'

captcha/getdistorts: randomRange requires integers

See merge request fatchan/jschan!255
indiachan-spamvector
Thomas Lynch 2 years ago
commit 3261de849d
  1. 4
      lib/captcha/getdistorts.js

@ -13,8 +13,8 @@ module.exports = async (width, height, numDistorts, distortion) => {
for (let i = 0; i < randNumDistorts; i++) {
//start and end of divided width
const divStart = (div * i)
, divEnd = (div * (i + 1));
const divStart = Math.floor(div * i)
, divEnd = Math.floor(div * (i + 1));
//origin coordinate for distortion point
const originx = await randomRange(divStart, divEnd)

Loading…
Cancel
Save