trait TransformationsTrait

Enables you to manage stored transformations.

Learn more: Transformations method - Admin API

Properties

ApiClient $apiClient Defined in AdminApi class.

Methods

transformations(array $options = [])

Lists stored transformations.

transformation(string|array $transformation, array $options = [])

Returns the details of a single transformation.

deleteTransformation(string|array $transformation, array $options = [])

Deletes the specified stored transformation.

updateTransformation(string|array $transformation, array $updates = [])

Updates the specified transformation.

createTransformation(string $name, Transformation|string|array $definition)

Creates a named transformation.

Details

ApiResponse transformations(array $options = [])

Lists stored transformations.

Parameters

Name Type Description
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_transformations

ApiResponse transformation(string|array $transformation, array $options = [])

Returns the details of a single transformation.

Parameters

Name Type Description
$transformation string|array The transformation. Can be either a string or an array of parameters. For example: "w_150,h_100,c_fill" or array("width" => 150, "height" => 100,"crop" => "fill").
$options array The optional parameters. See the admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_transformation_details

ApiResponse deleteTransformation(string|array $transformation, array $options = [])

Deletes the specified stored transformation.

Deleting a transformation also deletes all the stored derived assets based on this transformation (up to 1000). The method returns an error if there are more than 1000 derived assets based on this transformation.

Parameters

Name Type Description
$transformation string|array The transformation to delete. Can be either a string or an array of parameters. For example: "w_150,h_100,c_fill" or ["width" => 150, "height" => 100,"crop" => "fill"].
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

Exceptions

ApiError

See also

https://cloudinary.com/documentation/admin_api#delete_transformation

ApiResponse updateTransformation(string|array $transformation, array $updates = [])

Updates the specified transformation.

Parameters

Name Type Description
$transformation string|array The transformation. Can be either a string or an array of parameters. For example: "w_150,h_100,c_fill" or array("width" => 150, "height" => 100,"crop" => "fill").
$updates array The update parameters. See the Admin API documentation.

Return Value

ApiResponse

Exceptions

ApiError

See also

https://cloudinary.com/documentation/admin_api#update_transformation

ApiResponse createTransformation(string $name, Transformation|string|array $definition)

Creates a named transformation.

Parameters

Name Type Description
$name string The name of the transformation.
$definition Transformation|string|array The transformation. Can be either a defined Transformation, a string or an array of parameters. For example: "w_150,h_100,c_fill" or ["width" => 150, "height" => 100, "crop" => "fill"].

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#create_named_transformation