Sample code for resizing an image using Cold Fusion and csImageFile.

This is an example of resizing images in Cold Fusion using the csImageFile component. You will need the csImageFile component registered on your server as well as the sample files, which can be downloaded below.

Download the sample script - (2 KB)

Download the trial csImageFile component - (1 MB)

This is a very simple example. The path to the image is hard coded and the ResizeFit method is used for the resize. The parameters for this command can be changed if a diferent sized image is required.

<cfset Width = 320>
<cfset Height = 240>

<!-- resize the image -->
<cfset Image.ResizeFit(Width, Height)>

There are some working exmples in our live demonstration area.

For a full list of available Cold Fusion demos and tutorials for csImageFile - Click Here.