From 93c02436fb0b7afffb6c62547385757b1a1b57f8 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 29 Apr 2025 02:06:11 +0500 Subject: feat: download user's profile banner --- src/images.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/images.php') diff --git a/src/images.php b/src/images.php index 970fa99..d57794f 100644 --- a/src/images.php +++ b/src/images.php @@ -1,5 +1,5 @@ resizeImage($new_width, $new_height, Imagick::FILTER_TRIANGLE, 1); $frame->setImagePage($new_width, $new_height, 0, 0); } @@ -41,6 +46,11 @@ function resize_image(string $src_path, string $dst_path, int $max_width, int $m $new_width = (int) ($width * $ratio); $new_height = (int) ($height * $ratio); + if ($stretch) { + $new_width = $max_width; + $new_height = $max_height; + } + $imagick->resizeImage($new_width, $new_height, Imagick::FILTER_TRIANGLE, 1); $imagick->writeImage("$dst_path$format"); } -- cgit v1.2.3