diff --git a/src/Cms/FileModifications.php b/src/Cms/FileModifications.php index f5d0bc0e56..ffb227c347 100644 --- a/src/Cms/FileModifications.php +++ b/src/Cms/FileModifications.php @@ -176,7 +176,11 @@ public function thumb( // fallback to content file options if (($options['crop'] ?? false) === true) { - $options['crop'] = $this->focus()->value() ?? 'center'; + if ($this instanceof ModelWithContent === true) { + $options['crop'] = $this->focus()->value() ?? 'center'; + } else { + $options['crop'] = 'center'; + } } // fallback to global config options diff --git a/tests/Cms/Files/FileModificationsTest.php b/tests/Cms/Files/FileModificationsTest.php index 550c4f9e1c..355a223de8 100644 --- a/tests/Cms/Files/FileModificationsTest.php +++ b/tests/Cms/Files/FileModificationsTest.php @@ -58,7 +58,10 @@ public function testThumbWithAssetObject() { $app = $this->app->clone(); $asset = new Asset(''); - $result = $asset->thumb([]); + $result = $asset->thumb([ + 'crop' => true + ]); + $this->assertInstanceOf(Asset::class, $result); }