diff --git a/CHANGELOG.md b/CHANGELOG.md index 97f91a7..6f447a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Release Notes for Servd Assets and Helpers +## 4.0.8 - 2024-09-30 + +### Fixed + +- Added handling for image transform strings passed as an array + ## 4.0.7 - 2024-09-24 ### Fixed diff --git a/composer.json b/composer.json index 88739da..d6999cf 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "servd/craft-asset-storage", "description": "Servd Asset Storage and Helpers integration for Craft CMS", - "version": "4.0.7", + "version": "4.0.8", "type": "craft-plugin", "keywords": [ "cms", diff --git a/src/AssetsPlatform/AssetsPlatform.php b/src/AssetsPlatform/AssetsPlatform.php index 8cc432d..e5bb2a4 100644 --- a/src/AssetsPlatform/AssetsPlatform.php +++ b/src/AssetsPlatform/AssetsPlatform.php @@ -366,7 +366,13 @@ public function handleAssetTransform(Asset $asset, $transform, $force = true) } if (\is_array($transform)) { - $transform = new ImageTransform($transform); + // If this is a transform string wrapped in an array, fall through to the next block + // and treat it as a string. + if (isset($transform['transform']) && \is_string($transform['transform'])) { + $transform = $transform['transform']; + } else { + $transform = new ImageTransform($transform); + } } if (\is_string($transform)) {