From 7dd87f5bccda650f5d69e521f1cc9d33e2994b75 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 10 Apr 2022 12:08:14 +0200 Subject: feat(PHP8.1): Fix float to int conversion precision loss Signed-off-by: Florian Pritz --- application/libraries/Image/Drivers/GD.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/Image/Drivers/GD.php b/application/libraries/Image/Drivers/GD.php index e2e0a99be..2aecd18ca 100644 --- a/application/libraries/Image/Drivers/GD.php +++ b/application/libraries/Image/Drivers/GD.php @@ -128,8 +128,8 @@ class GD implements \libraries\Image\ImageDriver { $this->resize($temp_width, $temp_height); - $x0 = ($temp_width - $target_width) / 2; - $y0 = ($temp_height - $target_height) / 2; + $x0 = floor(($temp_width - $target_width) / 2); + $y0 = floor(($temp_height - $target_height) / 2); $this->crop($x0, $y0, $target_width, $target_height); $this->apply_exif_orientation(); -- cgit v1.2.3-24-g4f1b