Methods
-
otherwise( elseTx )
-
Description
An alternate transformation in case the initial condition is false Alias to
else
in many programming languagesParameters
Name Type Description elseTx
SDK.Transformation Details
Specifies a condition to be met before applying a transformation.
Name | Type | Description |
---|---|---|
exp |
string |
The condition to meet in order to apply the transformation. |
ifTx |
SDK.Transformation |
The transformation to conditionally apply |
// To be used through a builder and not to be created as an instance!
import {Cloudinary} from "@cloudinary/url-gen";
const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
const image = yourCldInstance.image('woman');
image.conditional(
Conditional.ifCondition('ar >= 1.0', new Transformation().addAction('w_100'))
);
image.toString()
// Transformation will contain `if_ar_gte_1.0/w_100/if_end`
An alternate transformation in case the initial condition is false
Alias to else
in many programming languages
Name | Type | Description |
---|---|---|
elseTx |
SDK.Transformation |