Skip to content

Commit cfd7c1a

Browse files
Merge pull request #6 from jatyPeng/patch-1
imagesetpixel需要传int类型参数,现在传的是浮点。代码会报错。
2 parents 804d3eb + e307765 commit cfd7c1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/VerifyCode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ private function writeCurve(): void
142142
$py = $A * sin($w * $px + $f) + $b + $this->conf->imageH / 2; // y = Asin(ωx+φ) + b
143143
$i = (int)($this->conf->fontSize / 5);
144144
while ($i > 0) {
145-
imagesetpixel($this->imInstance, $px + $i, $py + $i, $this->conf->fontColor);
145+
imagesetpixel($this->imInstance, intval($px + $i), intval($py + $i), $this->conf->fontColor);
146146
$i--;
147147
}
148148
}
149149
}
150150
}
151-
}
151+
}

0 commit comments

Comments
 (0)