ImageTransformerInterface
- Type
- Interface
- Namespace
- craft\base\imagetransforms
- Implemented by
- craft\imagetransforms\FallbackTransformer, craft\imagetransforms\ImageTransformer
- Since
- 4.0.0
TransformerInterface defines the common interface to be implemented by all image drivers.
View source (opens new window)
# Public Methods
Method | Description |
---|---|
getTransformUrl() | Returns the URL for an image transform. |
invalidateAssetTransforms() | Invalidates all transforms for an asset. |
# getTransformUrl()
Returns the URL for an image transform.
View source (opens new window)
Arguments
$asset
(craft\elements\Asset)$imageTransform
(craft\models\ImageTransform)$immediately
(boolean (opens new window)) – Whether the image should be transformed immediately
Returns
string (opens new window) – The URL for the transform
Throws
- yii\base\NotSupportedException (opens new window)
if the transformer can’t be used with the given asset. - craft\errors\ImageTransformException
if a problem occurs.
# invalidateAssetTransforms()
Invalidates all transforms for an asset.
View source (opens new window)
Arguments
$asset
(craft\elements\Asset)