From 50df3f69629cbed9275140fe54cd6393ef94d1b1 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 5 Mar 2020 18:17:11 +0100 Subject: [PATCH] fix #3474 @1 --- app/Models/Quiz.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Models/Quiz.php b/app/Models/Quiz.php index edc6d39eb..ea3dac0b2 100644 --- a/app/Models/Quiz.php +++ b/app/Models/Quiz.php @@ -9,6 +9,7 @@ use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel; use Cubist\Util\Files\Files; use Cubist\Util\Zip; use Spatie\MediaLibrary\Models\Media; +use Spatie\Image\Manipulations; class Quiz extends CubistMagicAbstractModel { @@ -152,8 +153,8 @@ class Quiz extends CubistMagicAbstractModel { parent::registerMediaConversions($media); - $this->addMediaConversion('logo_compile')->width(300)->height(100)->format('png'); - $this->addMediaConversion('banner_compile')->width(1920)->height(600)->format('jpg'); + $this->addMediaConversion('logo_compile')->width(300)->format('png'); + $this->addMediaConversion('banner_compile')->fit(Manipulations::FIT_CROP, 1920, 600)->format('jpg'); } /** @@ -235,7 +236,7 @@ class Quiz extends CubistMagicAbstractModel if (!can('viewany')) { $data['owner'] = auth()->user()->id; } - $res= parent::create($data); + $res = parent::create($data); return $res; } } -- 2.39.5