Update StoryController, optimize photo size by resizing to 9:16 aspect

This commit is contained in:
Daniel Supernault 2021-04-30 00:19:45 -06:00
parent ca00f2bb97
commit e66ed9a222
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -130,6 +130,9 @@ class StoryController extends Controller
if($story->type === 'photo') { if($story->type === 'photo') {
$img = Intervention::make($path); $img = Intervention::make($path);
$img->crop($width, $height, $x, $y); $img->crop($width, $height, $x, $y);
$img->resize(1080, 1920, function ($constraint) {
$constraint->aspectRatio();
});
$img->save($path, config('pixelfed.image_quality')); $img->save($path, config('pixelfed.image_quality'));
} }