Adobe ColdFusion 8

Using the cfimage tag resize action

Use the cfimage tag resize action to resize an image to the specified height and width. You can specify the height and width in pixels or as a percentage of the image's original dimensions. To specify a percentage, include the percent symbol (%) in the height and width definitions.

<!--- This example shows how to specify the height and width of an image in pixels. --->
<cfimage source="../cfdocs/images/artgallery/jeff01.jpg" action="resize" width="100"
    height="100" destination="jeff01_sm.jpg">
<!--- This example shows how to specify the height and width of an image as percentages. --->
<cfimage source="../cfdocs/images/artgallery/jeff02.jpg" action="resize" width="50%"
    height="50%" destination="jeff02_sm.jpg">

<!--- This example shows how to specify the height of an image in pixels and its width as a
    percentage. Notice that this can distort the image. --->
<cfimage source="../cfdocs/images/artgallery/jeff03.jpg" action="resize" width="50%"
    height="100" destination="jeff03_sm.jpg" overwrite="yes">

The cfimage tag requires that you specify both the height and the width for the resize action.

The cfimage tag resize action uses the highestQuality interpolation method for the best quality image (at the cost of performance). For faster display, use the ImageResize function or the ImageScaleToFit function.