summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2022-04-10 12:08:14 +0200
committerFlorian Pritz <bluewind@xinu.at>2022-04-10 14:44:35 +0200
commit7dd87f5bccda650f5d69e521f1cc9d33e2994b75 (patch)
treed28943edea4cc0be78dcf46a3574b4b6e8e5376b
parent4d59c3489042bab078c4a20ecfb3fde6aeb119cc (diff)
feat(PHP8.1): Fix float to int conversion precision loss
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/libraries/Image/Drivers/GD.php4
1 files 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();