Creates a ColdFusion image that can be manipulated by using image functions.
You can use the cfimage tag to perform common image manipulation operations as a shortcut to Image functions.
You can use the cfimage tag independently or in conjunction with image functions.
<cfimage>
cfimage();
read
border
captcha
convert
info
read
resize
rotate
write
writeToBrowser
low
high
medium
low
png
jpg
jpeg
false
true
false
false
true
false
0.75
1
highestQuality
highestQuality
highQuality
mediumQuality
highestPerformance
highPerformance
mediumPerformance
nearest
bilinear
bicubic
bessel
blackman
hamming
hanning
hermite
lanczos
mitchell
quadratic
Add a red border of 5 pixels to an image, write the output to a variable.
<cfimage action="border" source="#sourceImage#" size=5 color="red" name="withborder">
Generate a CAPTCHA style image using medium difficulty.
<cfimage action="captcha" width="200" height="50" text="Captcha!" difficulty="medium" fontSize="18" fonts="Comic Sans MS,Times New Roman">
Convert an image to a different format (in this case PNG).
<cfimage action="convert" source="#sourceImage#" destination="#expandPath( 'destination.png' )#" overwrite="true">
Retrieve meta data from an image and stores that as a structure in a variable.
<cfimage action="info" source="http://lorempixel.com/60/50/" structname="imageInfo">
<cfdump var="#imageInfo#">
Tag syntax for reading an image from a URL.
<cfimage action="read" name="sourceImage" source="http://lorempixel.com/60/50/">
Example of resizing an image stored in a variable and storing the result in a variable.
<cfimage action="resize" source="#sourceImage#" height="200" width="200" name="resized">
Rotate an image 30 degrees clockwise.
<cfimage action="rotate" source="#sourceImage#" destination="#expandPath( 'rotated.jpg' )#" overwrite="true" angle="30" quality="1">
Example of writing an image as an 80% compressed jpg image.
<cfimage action="write" source="#sourceImage#" destination="#expandPath( 'newImage.jpg' )#" overwrite="true" quality=".2">
Generates HTML to output the image in place.
<cfimage action="writeToBrowser" source="#sourceImage#">
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.