diff --git a/src/elements/Asset.php b/src/elements/Asset.php index e27bebd8613..fabae8a51eb 100644 --- a/src/elements/Asset.php +++ b/src/elements/Asset.php @@ -1837,6 +1837,7 @@ public function getUrlsBySize(array $sizes, mixed $transform = null): array 'quality', 'width', 'fill', + 'extraOptions', ]) : []; if ($unit === 'w') { diff --git a/src/helpers/ImageTransforms.php b/src/helpers/ImageTransforms.php index ef7a5222969..de6e3775969 100644 --- a/src/helpers/ImageTransforms.php +++ b/src/helpers/ImageTransforms.php @@ -121,6 +121,7 @@ public static function extendTransform(ImageTransform $transform, array $paramet 'quality', 'interlace', 'transformer', + 'extraOptions', ]; $nullables = [ @@ -304,6 +305,7 @@ public static function normalizeTransform(mixed $transform): ?ImageTransform 'upscale', 'quality', 'interlace', + 'extraOptions', ]); } diff --git a/src/models/ImageTransform.php b/src/models/ImageTransform.php index 8437d080f79..bd5d29d3d47 100644 --- a/src/models/ImageTransform.php +++ b/src/models/ImageTransform.php @@ -106,6 +106,12 @@ class ImageTransform extends Model */ public ?bool $upscale = null; + /** + * @var array|null Extra options + * @since 4.4.0 + */ + public ?array $extraOptions = null; + /** * @var string The image transformer to use. * @phpstan-var class-string @@ -318,6 +324,7 @@ public function getConfig(): array 'quality' => $this->quality, 'upscale' => $this->upscale ?? Craft::$app->getConfig()->getGeneral()->upscaleImages, 'width' => $this->width, + 'extraOptions' => $this->extraOptions, ]; } }