Simply include the image resize library with a cfinclude, and call the resizeImage function. With just 2 lines of code and only 3 functions you will be up and running in less time than it takes to install other options!
<cfinclude tempate="image_resize.cfm"> <cfset resizeImage(200,200, "/file/path/to/image.jpg")>
If you want to save the resized image to a new file pass it in as the fourth argument.
<cfinclude tempate="image_resize.cfm">
<cfset dimensions = getImageDimensions("/file/path/to/image.jpg")>
<cfoutput>#dimensions.width# x #dimensions.height#</cfoutput>
The getImageDimensions function returns a struct containing the height and width of an image.
<cfinclude tempate="image_resize.cfm"> <cfset newDimensions = resizeIf(100,100,"/file/path/to/image.jpg")>
The resizeIf function will only resize the image if either its current width or height are bigger than the bounds specified. This function automatically scales the image to preserve the aspect ratio. So if you passed in an image that was 200x100 it would get resized to 100x50 in the above example. The result image is always equal to or less than the max width and height passed in.
Download it and try it free. The demo is fully functional, however it overlays the word DEMO on resized images.
System Requirements: CF 5 or greater
The ColdFusion Image Resize UDF's are available in three purchasing options.
The unlimited use license allows you to install it on as many sites and servers as you need to. This license does not allow you to resell the component. This package includes the encrypted version.
Note: Foundeo Image Resize Library supports JPEG, PNG images, and some GIF formats. Please test using the trial before purchasing.