From 774557e8c9ab32a5ca6aa25f998f747d88871134 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 9 Aug 2018 20:31:14 -0600 Subject: [PATCH] Add custom image quality to config --- app/Util/Media/Image.php | 5 +++-- config/pixelfed.php | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Util/Media/Image.php b/app/Util/Media/Image.php index 3f67d43f5..236fc5c42 100644 --- a/app/Util/Media/Image.php +++ b/app/Util/Media/Image.php @@ -115,8 +115,9 @@ class Image { }); $converted = $this->setBaseName($path, $thumbnail, $img->extension); $newPath = storage_path('app/'.$converted['path']); - - $img->save($newPath, 75); + + $quality = config('pixelfed.image_quality'); + $img->save($newPath, $quality); if(!$thumbnail) { $media->orientation = $orientation; diff --git a/config/pixelfed.php b/config/pixelfed.php index 3e9782ac8..23526c1cc 100644 --- a/config/pixelfed.php +++ b/config/pixelfed.php @@ -86,7 +86,7 @@ return [ | | */ - 'max_account_size' => env('MAX_ACCOUNT_SIZE', 100000), + 'max_account_size' => env('MAX_ACCOUNT_SIZE', 1000000), /* |-------------------------------------------------------------------------- @@ -106,7 +106,7 @@ return [ | Change the caption length limit for new local posts. | */ - 'max_caption_length' => env('MAX_CAPTION_LENGTH', 150), + 'max_caption_length' => env('MAX_CAPTION_LENGTH', 500), /* |-------------------------------------------------------------------------- @@ -127,5 +127,15 @@ return [ | */ 'enforce_email_verification' => env('ENFORCE_EMAIL_VERIFICATION', true), + + /* + |-------------------------------------------------------------------------- + | Image Quality + |-------------------------------------------------------------------------- + | + | Set the image optimization quality, must be a value between 1-100. + | + */ + 'image_quality' => (int) env('IMAGE_QUALITY', 80), ]; \ No newline at end of file