diff --git a/app/Helpers/ImageHelpers.php b/app/Helpers/ImageHelpers.php index d1e65c7e..aa220026 100644 --- a/app/Helpers/ImageHelpers.php +++ b/app/Helpers/ImageHelpers.php @@ -30,7 +30,7 @@ class ImageHelpers private const IMAGE_SFW_FILENAME = 'image_sfw'; - public static function getImage($url, $width): ?EncodedImage + public static function getImage($url, $width = 400): ?EncodedImage { $outputType = config('images.type'); $image = static::downloadImage($url, $width); @@ -150,7 +150,7 @@ public static function createAndSaveArticleImage($url, $path): void ImageHelpers::storePublicImage($image, $path . '/image.' . config('images.type'), false); } - private static function downloadImage($url, $width): ?ImageInterface + private static function downloadImage($url, $width = 400): ?ImageInterface { if (empty($url)) { return null; @@ -163,7 +163,7 @@ private static function downloadImage($url, $width): ?ImageInterface } $image = $response->body(); $image = $manager->read($image); - $image = $image->scaleDown(width: $width ?? 400); + $image = $image->scaleDown(width: $width); return $image; } catch (Exception $exception) {