Skip to content

Commit

Permalink
Fixes type error when resizing uploaded avatars
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <[email protected]>
  • Loading branch information
Sesquipedalian committed Jun 22, 2024
1 parent 7ae90c0 commit f93c8b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/Graphics/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down

0 comments on commit f93c8b8

Please sign in to comment.