Skip to content

Commit

Permalink
Update Util.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mirarus committed Sep 2, 2022
1 parent 89ae905 commit fe42d9c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Util/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,25 +418,25 @@ public static function image_resize(string $file, int $w, int $h, bool $crop = f

if ($savePath) {
if (exif_imagetype($file) == 1) {
imagegif($dst, $savePath);
$dst = imagegif($dst, $savePath);
} elseif (exif_imagetype($file) == 2) {
imagejpeg($dst, $savePath, 100);
$dst = imagejpeg($dst, $savePath, 100);
} elseif (exif_imagetype($file) == 3) {
imagepng($dst, $savePath, 100);
$dst = imagepng($dst, $savePath, 100);
} elseif (exif_imagetype($file) == 6) {
imagebmp($dst, $savePath);
$dst = imagebmp($dst, $savePath);
} elseif (exif_imagetype($file) == 15) {
imagewbmp($dst, $savePath);
$dst = imagewbmp($dst, $savePath);
} elseif (exif_imagetype($file) == 16) {
imagexbm($dst, $savePath);
$dst = imagexbm($dst, $savePath);
} elseif (exif_imagetype($file) == 18) {
imagewebp($dst, $savePath, 100);
$dst = imagewebp($dst, $savePath, 100);
} else {
imagejpeg($dst, $savePath, 100);
$dst = imagejpeg($dst, $savePath, 100);
}
} else {
return $dst;
}

return $dst;
}

/**
Expand Down

0 comments on commit fe42d9c

Please sign in to comment.