shrinkToFit()

Overview

public binary function shrinkToFit(
      required binary  asset  
    , required numeric width  
    , required numeric height 
    ,          string  quality = "highPerformance"
)

Shrinks an native image to fit within a given width and height, without changing the native images aspect ratio.

Arguments

NameTypeRequiredDescription
assetbinaryYesBinary of the native image to transorm
widthnumericYesMaximum width for the native image, in pixels
heightnumericYesMaximum height for the native image, in pixels
qualitystringNo (default="highPerformance")Resize algorithm quality. Options are: highestQuality, highQuality, mediumQuality, highestPerformance, highPerformance and mediumPerformance