Explicit float to int conversion (#153)

Prevent "Implicit conversion from float (number) to int loses precision" errors.
This commit is contained in:
Ignacio Larrain 2022-04-29 04:11:33 -04:00 committed by GitHub
parent b6e5513d5e
commit ec4e430112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,7 @@ for($i = 0; $i < $num_chars; $i++) {
$txt_col = $textcols[rand(0,1)]; $txt_col = $textcols[rand(0,1)];
$txt_font = $fonts[array_rand($fonts)]; $txt_font = $fonts[array_rand($fonts)];
$txt = $human_proof[$i]; $txt = $human_proof[$i];
imagettftext($image, $size, $angle, $txt_x, $txt_y, $txt_col, $txt_font, $txt); imagettftext($image, $size, $angle, (int)$txt_x, (int)$txt_y, $txt_col, $txt_font, $txt);
# print "imagettftext( $size, $angle, $txt_x, $txt_y, $txt_col, $txt_font, $txt);<p>"; # print "imagettftext( $size, $angle, $txt_x, $txt_y, $txt_col, $txt_font, $txt);<p>";
} }