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


.new()

Convenience constructor method


#and()


#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

#or()


#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

#predicate()

Add a condition


#then()

Conclude condition

Returns: Transformation

the transformation this condition is defined for

Type
Transformation

#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