class ExpressionOperator extends BaseExpression

Defines the supported image characteristics for conditional transformations.

Learn more: Supported image characteristics

Methods

__construct($exprUserVariableName)

ExpressionComponent constructor.

__toString()

Serializes to string.

jsonSerialize()

Serializes to JSON.

width()

The asset's current width.

initialWidth()

The asset's initial width.

height()

The asset's current height.

initialHeight()

The asset's initial height.

aspectRatio()

The aspect ratio of the asset. The compared value can be either decimal (e.g., 1.5) or a ratio (e.g., 3:4)

initialAspectRatio()

The initial aspect ratio of the asset.

trimmedAspectRatio()

The aspect ratio of the image IF it was trimmed (using the Effect::trim effect) without actually trimming the image.

pageCount()

The total number of pages in the image/document.

faceCount()

The total number of detected faces in the image.

illustrationScore()

The likelihood that the image is an illustration (as opposed to a photo).

currentPage()

The current page in the image/document.

pageX()

The page X.

pageY()

The page Y.

tags()

The set of tags assigned to the asset.

context()

A context value assigned to an asset.

generic(string $genericPredefinedVariable)

Generic (future) predefined variable name.

uVar(string $variableName)

Sets the user variable by name.

int(int $value)

Sets the integer value.

float(float $value)

Sets the float value.

numeric(int|float|mixed $value)

Sets the numeric value.

string(string $value)

Sets the string value.

stringArray(array $value)

Sets the value.

assetReference(string $publicId)

Sets the asset reference value.

expression(mixed $value)

Sets the expression value.

Details

__construct($exprUserVariableName)

ExpressionComponent constructor.

Parameters

Name Type Description
$exprUserVariableName

string __toString()

Serializes to string.

Return Value

string

mixed jsonSerialize()

Serializes to JSON.

Return Value

mixed

Expression width()

The asset's current width.

Return Value

Expression

Expression initialWidth()

The asset's initial width.

Return Value

Expression

Expression height()

The asset's current height.

Return Value

Expression

Expression initialHeight()

The asset's initial height.

Return Value

Expression

Expression aspectRatio()

The aspect ratio of the asset. The compared value can be either decimal (e.g., 1.5) or a ratio (e.g., 3:4)

Return Value

Expression

Expression initialAspectRatio()

The initial aspect ratio of the asset.

Return Value

Expression

Expression trimmedAspectRatio()

The aspect ratio of the image IF it was trimmed (using the Effect::trim effect) without actually trimming the image.

The compared value can be either decimal (e.g., 1.5) or a ratio (e.g., 3:4).

Return Value

Expression

See also

Effect::trim

Expression pageCount()

The total number of pages in the image/document.

Return Value

Expression

Expression faceCount()

The total number of detected faces in the image.

Return Value

Expression

Expression illustrationScore()

The likelihood that the image is an illustration (as opposed to a photo).

Supported values: 0 (photo) to 1 (illustration)

Return Value

Expression

Expression currentPage()

The current page in the image/document.

Return Value

Expression

Expression pageX()

The page X.

Return Value

Expression

Expression pageY()

The page Y.

Return Value

Expression

Expression tags()

The set of tags assigned to the asset.

Used with the Expression::in or Expression::notIn operators.

Note: The syntax for this characteristic is slightly different: if_!!_in_tags, where the : delimiter denotes AND.

Return Value

Expression

See also

Expression::in
Expression::notIn

Expression context()

A context value assigned to an asset.

Return Value

Expression

Expression generic(string $genericPredefinedVariable)

Generic (future) predefined variable name.

Parameters

Name Type Description
$genericPredefinedVariable string The name of the predefined variable

Return Value

Expression

Expression uVar(string $variableName)

Sets the user variable by name.

Parameters

Name Type Description
$variableName string The user variable name.

Return Value

Expression

Expression int(int $value)

Sets the integer value.

Parameters

Name Type Description
$value int The value.

Return Value

Expression

Expression float(float $value)

Sets the float value.

Parameters

Name Type Description
$value float The value.

Return Value

Expression

Expression numeric(int|float|mixed $value)

Sets the numeric value.

Parameters

Name Type Description
$value int|float|mixed The value.

Return Value

Expression

Expression string(string $value)

Sets the string value.

Parameters

Name Type Description
$value string The value.

Return Value

Expression

Expression stringArray(array $value)

Sets the value.

Parameters

Name Type Description
$value array The array value.

Return Value

Expression

Expression assetReference(string $publicId)

Sets the asset reference value.

Parameters

Name Type Description
$publicId string The public ID of the file.

Return Value

Expression

ExpressionTrait expression(mixed $value)

Sets the expression value.

Parameters

Name Type Description
$value mixed The expression value.

Return Value

ExpressionTrait