Explorar o código

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

Daniel Supernault %!s(int64=4) %!d(string=hai) anos
pai
achega
e66ed9a222
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      app/Http/Controllers/StoryController.php

+ 3 - 0
app/Http/Controllers/StoryController.php

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