Resizes a ColdFusion image.
imageResize(name, width, height, interpolation, blurfactor)
→ returns void
someImage.resize(width, height, interpolation, blurfactor)
highestQuality (default)
highQuality
mediumQuality
highestPerformance
highPerformance
mediumPerformance
nearest
bilinear
bicubic
bessel
blackman
hamming
hanning
hermite
lanczos
mitchell
quadratic
1-10
This example shows how to resize an image to 50% of original size and resize it proportionately to the new width. Notice that the height is blank.
<cfset myImage=imageNew("http://www.google.com/images/logo_sm.gif")>
<cfset imageResize(myImage,"50%","","blackman",2)>
<!--- Save the modified image to a file called "test_myImage.jpeg" and display the image in a browser. --->
<cfimage source="#myImage#" action="write" destination="test_myImage.jpeg" overwrite="yes">
<!--- Display the source image and the thumbnail image. --->
<img src="http://www.google.com/images/logo_sm.gif"/>
<img src="test_myImage.jpeg"/>
CF 11+ Resize an image
imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.resize(50,50);
cfimage(action="writeToBrowser", source=imgObj);
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.