Class: Condition

Condition


new Condition(conditionStr)

Represents a transformation condition

Parameters:
Name Type Description
conditionStr string

a condition in string format

Example
// normally this class is not instantiated directly
var tr = cloudinary.Transformation.new()
   .if().width( ">", 1000).and().aspectRatio("<", "3:4").then()
     .width(1000)
     .crop("scale")
   .else()
     .width(500)
     .crop("scale")

var tr = cloudinary.Transformation.new()
   .if("w > 1000 and aspectRatio < 3:4")
     .width(1000)
     .crop("scale")
   .else()
     .width(500)
     .crop("scale")

Methods


#aspectRatio(operator, value)

Parameters:
Name Type Description
operator string

the comparison operator (e.g. "<", "lt")

value string | number

the right hand side value

Returns: Condition

this condition

Type
Condition

#faces(operator, value)

Parameters:
Name Type Description
operator string

the comparison operator (e.g. "<", "lt")

value string | number

the right hand side value

Returns: Condition

this condition

Type
Condition

#height(operator, value)

Parameters:
Name Type Description
operator string

the comparison operator (e.g. "<", "lt")

value string | number

the right hand side value

Returns: Condition

this condition

Type
Condition

#pages(operator, value)

Parameters:
Name Type Description
operator string

the comparison operator (e.g. "<", "lt")

value string | number

the right hand side value

Returns: Condition

this condition

Type
Condition

#width(operator, value)

Parameters:
Name Type Description
operator string

the comparison operator (e.g. "<", "lt")

value string | number

the right hand side value

Returns: Condition

this condition

Type
Condition