Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

problem with ImageResize & cfimage

New Here ,
Mar 16, 2009 Mar 16, 2009
I have some code to resize the images in loop

<cfloop index="i" from="1" to="#ArrayLen(fr)#" step="1">
<cfset myImage=ImageNew("#Application.site#/img/albums/temp/#fr ['to']#")>
<cfset info=ImageInfo(myImage)>
<cfset ImageResize(myImage,"50","")>
<cfimage source="#myImage#" action="write" destination="#Application.site#/img/albums/1/a.#aid#/#fr
['to']#" overwrite="yes">
</cfloop>

when the images more then 1mb Loop return with timeout error (The request has exceeded the allowable time limit Tag: CFLOOP)
How i can run cfimage and imageresize in background mode? Or any other way to solve this problem?
TOPICS
Advanced techniques
505
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2009 Mar 16, 2009
> How i can run cfimage and imageresize in background mode? Or any other way to
> solve this problem?

Read up on <cfthread>

http://livedocs.adobe.com/coldfusion/8/Tags_t_04.html

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 17, 2009 Mar 17, 2009
LATEST
I try to use cfthread, but resizing is not working.
Where my error?

<cfloop index="i" from="1" to="#ArrayLen(fr)#" step="1">
<cfthread action="run" name="#i#">
<cfset myImage=ImageNew("#Application.site#/img/albums/temp/#fr ['to']#")>
<cfset info=ImageInfo(myImage)>
<cfif info.width gt "50">
<cfset ImageResize(myImage,"50","")>
</cfif>
<cfimage source="#myImage#" action="write" destination="#Application.site#/img/albums/1/a.#aid#/#fr
['to']#" overwrite="yes">
</cfthread>
</loop>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 16, 2009 Mar 16, 2009
Note that if the server has a set timeout (using SeeFusion or some other method) then even using CFThread won't get around this - you'll have to reduce the allowable size of your image to make sure processing time is less than the timeout or contact the remote host and ask for an exemption for that page...though it's unlikely they will grant it since the timeout exists for a reason (to ensure the server runs smoothly).
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources