OpenWGA 7.9 - TMLScript reference

ImageScaler
Method :

scaleByFactor(widthFactor, heightFactor)

On object ImageScaler
Usage Scales the image based on a factor
Description This method can be used to scale images based on factors. A factor higher than 1 will enlargen the dimension, a factor lower that 1 will shrink it.

For example use factor 2 to double the size of the dimension. Use factor 0.5 to shrink it.

As you are able to set both dimensions individually here this method will not automatically keep the original  aspect ration of the image. This is only the case if the same factors are used on both dimensions.
Parameters widthFactor (Number):
Scale factor for the image width

heightFactor (Number):
Scale factor for the image height
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
    portletevent