Skip to content

Commit 147fc9d

Browse files
committed
Fix precision loss deprecation on float to int conversion
1 parent d002547 commit 147fc9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

system/Images/Handlers/GDHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ protected function process(string $action)
188188
imagesavealpha($dest, true);
189189
}
190190

191-
$copy($dest, $src, 0, 0, $this->xAxis, $this->yAxis, $this->width, $this->height, $origWidth, $origHeight);
191+
$copy($dest, $src, 0, 0, (int) $this->xAxis, (int) $this->yAxis, $this->width, $this->height, $origWidth, $origHeight);
192192

193193
imagedestroy($src);
194194
$this->resource = $dest;
@@ -472,9 +472,9 @@ protected function textOverlay(string $text, array $options = [], bool $isShadow
472472
// Add the shadow to the source image
473473
if (! empty($options['fontPath'])) {
474474
// We have to add fontheight because imagettftext locates the bottom left corner, not top-left corner.
475-
imagettftext($src, $options['fontSize'], 0, $xAxis, $yAxis + $options['fontheight'], $color, $options['fontPath'], $text);
475+
imagettftext($src, $options['fontSize'], 0, (int) $xAxis, (int) ($yAxis + $options['fontheight']), $color, $options['fontPath'], $text);
476476
} else {
477-
imagestring($src, $options['fontSize'], $xAxis, $yAxis, $text, $color);
477+
imagestring($src, (int) $options['fontSize'], (int) $xAxis, (int) $yAxis, $text, $color);
478478
}
479479

480480
$this->resource = $src;

0 commit comments

Comments
 (0)