From f93c8b8e086351317f7e7f46b06770f8d3fd6a0e Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Sat, 22 Jun 2024 01:19:14 -0600 Subject: [PATCH] Fixes type error when resizing uploaded avatars Signed-off-by: Jon Stovell --- Sources/Graphics/Image.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Graphics/Image.php b/Sources/Graphics/Image.php index d0fd0fc1aa..6c09700243 100644 --- a/Sources/Graphics/Image.php +++ b/Sources/Graphics/Image.php @@ -1139,11 +1139,11 @@ protected function resizeUsingGD(string $destination, int $max_width, int $max_h // Determine whether to resize to max width or to max height (depending on the limits.) if (!empty($max_width) && (empty($max_height) || round($this->height * $max_width / $this->width) <= $max_height)) { - $dst_width = $max_width; - $dst_height = round($this->height * $max_width / $this->width); + $dst_width = (int) $max_width; + $dst_height = (int) round($this->height * $max_width / $this->width); } elseif (!empty($max_height)) { - $dst_width = round($this->width * $max_height / $this->height); - $dst_height = $max_height; + $dst_width = (int) round($this->width * $max_height / $this->height); + $dst_height = (int) $max_height; } // Don't bother resizing if it's already smaller...