|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
cfimage in loop kills loop and throws error
Show us your code. It could be that you're running out of memory. What errorAdrian Lynch 01/08/09 08:11 P <cfloop query="whatever">Tony Bentley 01/08/09 08:27 P ERROR: The request has exceeded the allowable time limit Tag: CFLOOPTony Bentley 01/08/09 08:33 P That error means exactly what it says: your cfloop is running for longerMatt Quackenbush 01/08/09 08:48 P Add this to the top of the page to get CF to wait longer:Adrian Lynch 01/08/09 08:54 P That took care of it. Thanks folks.Tony Bentley 01/09/09 01:50 P I am having problems with cfimage when it comes to large images. Say 1mb each and over 50 images. I upload the images in a zipped folder, unzip them, run a loop to resize the original 4 times (original, medium, thumb and mini thumb). I know that it all works as long as the images are small enough in file size and the quantity is less than 50. So again, if the zipped folder is 500kb x 50 images or less it works. I want to be able to upload 1.5mb sized images and up to 100 (or no limit ideally). The page request is unlimited so what could be causing it? I tried using cfthread for each request but only about half would run and the rest would update the database but not run resizing functions. Show us your code. It could be that you're running out of memory. What error are you getting? Adrian Building a database of ColdFusion errors at http://cferror.org/ ----- Excess quoted text cut - see Original Post for more ----- <cfloop query="whatever"> <cfimage source="#large#\#imgname#" name="objImage" action="read" /> <cffile action="delete" file="#large#\#imgname#" > <!--- get the image filename ---> <cfquery name="getimgs" datasource="#client.datasource#"> select title from gallery where imgid = '#id#' </cfquery> <cfquery name="update_large" datasource="#client.datasource#"> UPDATE gallery SET image = '#imgname#' where imgid = '#id#' </cfquery> <cfif objImage.width gt 1200> <cfset ImageScaleToFit(objImage,1200,1200,"highestPerformance")> <cfimage overwrite="yes" action="write" source="#objImage#" destination="#large#\#imgname#" format="jpg" /> <cfelse> <cfimage overwrite="yes" action="write" source="#objImage#" destination="#LargeDir#\#imgname#" format="jpg" /> </cfif> </cfif> <cfif isImage(objImage)> <cfif objImage.width gt 700> <cfset ImageScaleToFit(objImage,700,700,"highestPerformance")> </cfif> <cfimage overwrite="yes" action="write" source="#objImage#" destination="#LargeDir##id#.jpg" format="jpg" /> <cfset ImageScaleToFit(objImage,150,150,"highestPerformance")> <cfimage overwrite="yes" action="write" source="#objImage#" destination="#ThumbDir##id#.jpg" format="jpg" /> <!--- scale to flash size ---> <cfset ImageScaleToFit(objImage,75,75,"highestPerformance")> <!--- crop to center ---> <cfif objImage.width gt objImage.height> <cfset imageCrop(objImage,12.5,0,50,50)> <cfelse> <cfset imageCrop(objImage,0,12.5,50,50)> </cfif> <cfimage overwrite="yes" action="write" source="#objImage#" destination="#FlashDir##id#.jpg" format="jpg" /> </cfloop> ERROR: The request has exceeded the allowable time limit Tag: CFLOOP That error means exactly what it says: your cfloop is running for longer than is allowable. Try adding a requesttimeout setting and playing with the length. <cfsetting requesttimeout="{number of seconds" /> On Thu, Jan 8, 2009 at 7:22 PM, Tony Bentley wrote: > ERROR: The request has exceeded the allowable time limit Tag: CFLOOP > Add this to the top of the page to get CF to wait longer: <cfsetting requesttimeout="999999"> Adrian > ERROR: The request has exceeded the allowable time limit Tag: CFLOOP That took care of it. Thanks folks.
|
March 21, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||