
981
DEVELOPING
COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Las
t
upda
te
d 8/5/2010
<!--- Determine whether a valid image file exists. --->
<cfif IsImageFile("../cfdocs/images/artgallery/#form.art#")>
<cfset original=ImageNew("../cfdocs/images/artgallery/#form.art#")>
<!--- Use the ImageNew function to create a clone of the ColdFusion image. --->
<cfset clone1=ImageNew(original)>
<!--- Use the ImageSharpen function to blur the cloned image. --->
<cfset ImageSharpen(clone1,-1)>
<!--- Use the ImageNew function to create a second clone of the original image. --->
<cfset clone2=ImageNew(original)>
<!--- Use the ImageSharpen function to sharpen the cloned image. --->
<cfset ImageSharpen(clone2,1)>
<!--- Use the ImageNew function to create a third clone for the original image. --->
<cfset clone3=ImageNew(original)>
<!--- Use the ImageSharpen function to sharpen the cloned image to the maximum setting.
--->
<cfset ImageSharpen(clone3,2)>
<!--- Create a form with a radio button for each selection. The value of the hidden field
is the relative path of the original image file. --->
<p>Please choose an image:</p>
<table>
<tr>
<cfform action="dupImage3.cfm" method="post">
<td><cfimage source="#original#" action="writeToBrowser"><br />
<cfinput type="radio" name="foo" value="original">Original Image</td>
<td><cfimage source="#clone1#" action="writeToBrowser"><br />
<cfinput type="radio" name="foo" value="blurred">Blurred Image</td>
<td><cfimage source="#clone2#" action="writeToBrowser"><br />
<cfinput type="radio" name="foo" value="sharper">Sharper Image</td>
<td><cfimage source="#clone3#" action="writeToBrowser"><br />
<cfinput type="radio" name="foo" value="sharpest">Sharpest Image</td>
<tr><td><cfinput type="Submit" name="OK" value="OK">
<cfinput type="hidden" name="orig_file"
value="../cfdocs/images/artgallery/#form.art#">
</td></tr>
</cfform>
</tr>
</table>
<cfelse>
<p>There is no image associated with the title you selected. Please click the Back button
and try again.</p>
</cfif>
On the second action page, save the selected image to the C drive: