CF Builder freezing when I edit a particular file
I recently started using CFB 2. Going into an old application and editing some of its files, I noticed that it freezes repeatedly with a particular file. It uses the old cfx_image and I was updating it to use CFIMAGE at multiple loctions within the file. Not sure what might be going on. Text of the file is attached.
Thanks
Khaled
=======================
<cfinclude template="../ActLockEnforce.cfm">
<!--- THIS PAGE USES CFX_IMAGE --->
<!--- CREATES THUMBNAILS ON THE FLY AND SPECIFIES THE SIZE --->
<cfmodule template="../tags/autoresize.cfm" filefield="PicFile" imagepath="#ExpandPath('../picFiles/')#" thumbpath="#ExpandPath('../ThumbsFiles/')#" thumbsize="150">
<!--- maxsize="450" --->
<!--- IF THE PICTURE FILE IS TOO BIG, SOUND A WARNING AND ROLLBACK THE WHOLE PROCEDURE --->
<!--- DEBUG: checkignsize <br> --->
<cfif photoSize GT (request.picSize*1000)>
<!--- DEBug: pic too big<br> --->
<cfset size = photosize\2000>
<cfset d =
<!--- <cfoutput >#expandpath('../pic/#photo#')#<br>
size is #size#</cfoutput>
<cfabort> --->
<!--- debug: deleting pic & thujmb<br> --->
<cffile action="DELETE" file="#expandpath('../picFiles/#photo#')#">
<cffile action="DELETE" file="#expandpath('../ThumbsFiles/#photo#')#">
<cfoutput>
<script>
alert('Your uploaded file was #size# KB. \n The maximum file size you can upload is #request.picSize# KB. \n Your operation has been cancelled')
</script>
</cfoutput>
<cfinclude template="../queries/qryGetCategories.cfm">
<cfset attributes.fuseaction="UpLoadForm">
<cfinclude template="index.cfm" >
<cfelseif TheWidth LT request.minwidth><!--- if the picture is too narrow, stop --->
<!--- debug: picture too narrow<br> --->
<cffile action="DELETE" file="#expandpath('../picFiles/#photo#')#">
<cffile action="DELETE" file="#expandpath('../ThumbsFiles/#photo#')#">
<cfoutput>
<script>
alert("The width of the uploaded picture is #TheWidth# pixels, too small for display. \n The minimum width required is #request.minwidth# pixels. \n Please resize your picture and upload again. \n Your operation has been cancelled ")
</script>
</cfoutput>
<cfinclude template="../queries/qryGetCategories.cfm">
<cfset attributes.fuseaction="UpLoadForm">
<cfinclude template="index.cfm" >
<cfelse><!--- if the picture size is ok, insert the water mark logo5 --->
<!--- debug: putting water mark<br>
<CFX_IMAGE
ACTION="PASTE"
FILE="#expandpath('..\graphics\logo5.gif')#"
TO_FILE="#expandpath('..\PicFiles\#photo#')#"
OUTPUT="#expandpath('..\PicFiles\#photo#')#"
x="0"
y="0"
transparent="yes"
origin="top"> --->
<cfimage action="read" name="thephoto" source="#expandpath('..\PicFiles\#photo#')#" >
<!--- insert into PIX table --->
<!--- "TheWidth comes from cfx_image in the AutoResize Custom tag --->
<cflock timeout="2" throwontimeout="No" type="READONLY" scope="SESSION">
<cfset memberID = session.memberID>
</cflock>
<cfmodule template="../tags/max_ID.cfm"
datasource="#request.DSN#"
tablename="pix"
primarykey="picID">
<cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="ActInsertPic" datasource="#request.dsn#" >
INSERT into pix (picID, PicFile, PicThumbFile, CategoryID, OwnerID,
forSale, StatusID, DatePosted,PicTitle, PicInfo, width, height )
VALUES (#max_id#, '#photo#', '#photo#', #CategoryID#, #memberID#, #forSale#, #request.newstatus#, #CreateODBCDateTime(Now ())#, '#HTMLEditFormat(PicTitle)#', '#HTMLEditFormat(PicInfo)#', #TheWidth#, #TheHeight#)
</cfquery>
<!--- insert a blank line in the VOTESPIX table so you can retrieve pictures, even if the picture does not have any votes in queries/ActSearch.cfm --->
<cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="insertvote" datasource="#request.dsn#" dbtype="ODBC">
INSERT into VotesPics (picID )
VALUES (#max_id#)
</cfquery>
<!--- save max_id before getting new values for KeyWords and Prices --->
<cfset newPicID = max_ID>
<!--- insert keywords --->
<cfloop index="word" list="#attributes.keywords#" delimiters=" ,">
<cfmodule template="../tags/max_ID.cfm"
datasource="#request.DSN#"
tablename="KeyWords"
primarykey="KeyWordID">
<cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="actInsertKeywords" datasource="#request.dsn#" dbtype="ODBC">
INSERT into KeyWords (KeyWordID, PicID, KeyWord )
VALUES (#max_id#, #newPicID#, '#word#')
</cfquery>
</cfloop>
<cfif attributes.forSale is 1><!--- if picture is for sale, insert prices --->
<cfloop index="sizenumber" from="1" to="#numberOfSizes#">
<!--- <cfif val(attributes.price#sizeNumber#) GT 0> --->
<cfmodule template="../tags/max_ID.cfm"
datasource="#request.DSN#"
tablename="prices"
primarykey="priceID">
<cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="ActInsertPrices" datasource="#request.dsn#" dbtype="ODBC">
INSERT into prices (priceID, PicID, sizeID,price )
VALUES (#max_id#, #NewPicID#, #sizeNumber#, #evaluate('attributes.price' & sizeNumber)# )
</cfquery>
<!--- </cfif> --->
</cfloop>
</cfif>
<!--- start setting parameters for history insertion --->
<!--- memberID defined above in the session lock --->
<cfset ztransaction = "upload">
<cfset PicID = newPicID>
<!--- <cfif request.costPerPic GT 0 and enforce>if pictue upload is not free --->
<!--- set transaction value to picture upload price
<cfset ztransactionsum = request.costPerPic>--->
<!--- increase number of pix uploaded --->
<!--- <cfinclude template="../queries/ActIncrementPixUploaded.cfm"> incrment when approved, not when uploaded
<cfelse>
<cfset ztransactionSum = 0>
</cfif>--->
<!--- deBUG POINT: inserting histroy<BR> --->
<!--- <cfinclude template="../admin/ActInsertHistory.cfm"> No more hx for upload--->
<cfinclude template="DspUploadLanding.cfm">
</cfif>
