From 067348835299febed3080ab61ffca365cd07743f Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 27 Apr 2025 22:24:05 +0500 Subject: feat: change username and pfp --- src/images.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/images.php') diff --git a/src/images.php b/src/images.php index fea1825..970fa99 100644 --- a/src/images.php +++ b/src/images.php @@ -1,5 +1,5 @@ readImage($src_path); - $format = strtolower($imagick->getImageFormat()); + $format = "." . strtolower($imagick->getImageFormat()); + + if (!$set_format) { + $format = ""; + } if ($imagick->getNumberImages() > 1) { $imagick = $imagick->coalesceImages(); @@ -29,7 +33,7 @@ function resize_image(string $src_path, string $dst_path, int $max_width, int $m } $imagick = $imagick->deconstructImages(); - $imagick->writeImages("$dst_path.$format", true); + $imagick->writeImages("$dst_path$format", true); } else { $width = $imagick->getImageWidth(); $height = $imagick->getImageHeight(); @@ -38,7 +42,7 @@ function resize_image(string $src_path, string $dst_path, int $max_width, int $m $new_height = (int) ($height * $ratio); $imagick->resizeImage($new_width, $new_height, Imagick::FILTER_TRIANGLE, 1); - $imagick->writeImage("$dst_path.$format"); + $imagick->writeImage("$dst_path$format"); } $imagick->clear(); -- cgit v1.2.3