ImageTransforms

Type
Class
Namespace
craft\helpers
Inherits
craft\helpers\ImageTransforms
Since
4.0.0

Image Transforms helper.

View source (opens new window)

# Public Methods

Method Description
createTransformFromString() Create an AssetImageTransform model from a string.
detectTransformFormat() Detect the auto web-safe format for the Asset. Returns null, if the Asset is not an image.
extendTransform() Extend a transform by taking an existing transform and overriding its parameters.
getLocalImageSource() Get a local image source to use for transforms.
getTransformString() Get the transform string for a given asset image transform.
normalizeTransform() Normalize a transform from handle or a set of properties to an ImageTransform.
storeLocalSource() Store a local image copy to a destination path.

# createTransformFromString()

Create an AssetImageTransform model from a string.

View source (opens new window)

Arguments

Returns

craft\models\ImageTransform

# detectTransformFormat()

Detect the auto web-safe format for the Asset. Returns null, if the Asset is not an image.

View source (opens new window)

Arguments

Returns

string (opens new window)

Throws

# extendTransform()

Extend a transform by taking an existing transform and overriding its parameters.

View source (opens new window)

Arguments

Returns

craft\models\ImageTransform

# getLocalImageSource()

Get a local image source to use for transforms.

View source (opens new window)

Arguments

Returns

string (opens new window)

Throws

# getTransformString()

Get the transform string for a given asset image transform.

View source (opens new window)

Arguments

Returns

string (opens new window)

# normalizeTransform()

Normalize a transform from handle or a set of properties to an ImageTransform.

View source (opens new window)

Arguments

  • $transform (mixed)

Returns

craft\models\ImageTransform, null (opens new window)

Throws

# storeLocalSource()

Store a local image copy to a destination path.

View source (opens new window)

Arguments

Throws

# Constants

Constant Description
TRANSFORM_STRING_PATTERN