From e6179f3951dc96ce02834bcadf5ad4f0db2bb1c6 Mon Sep 17 00:00:00 2001 From: Thomas Vantuycom Date: Wed, 26 Jul 2023 10:18:16 +0200 Subject: [PATCH] fix: parse .env variables in image transforms Resolves #1. --- src/imagetransforms/CloudinaryTransformer.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/imagetransforms/CloudinaryTransformer.php b/src/imagetransforms/CloudinaryTransformer.php index ba8e100..acb4f40 100644 --- a/src/imagetransforms/CloudinaryTransformer.php +++ b/src/imagetransforms/CloudinaryTransformer.php @@ -5,6 +5,7 @@ use Cloudinary\Cloudinary; use Cloudinary\Transformation\Gravity; use Cloudinary\Transformation\Resize; +use Craft; use craft\base\Component; use craft\base\imagetransforms\ImageTransformerInterface; use craft\elements\Asset; @@ -73,9 +74,9 @@ protected function client($cloudName, $apiKey, $apiSecret): Cloudinary { $config = [ 'cloud' => [ - 'cloud_name' => $cloudName, - 'api_key' => $apiKey, - 'api_secret' => $apiSecret, + 'cloud_name' => Craft::parseEnv($cloudName), + 'api_key' => Craft::parseEnv($apiKey), + 'api_secret' => Craft::parseEnv($apiSecret), ], ];