开发者

Creating Thumbnails with CFImage Aborting Because of Server Load?

开发者 https://www.devze.com 2022-12-23 07:47 出处:网络
I am uploading in image via a form and I want to, in addition to saving the image, save a variet开发者_如何转开发y of thumbnails in both png and jpg format.To do this I am using the code below.The ini

I am uploading in image via a form and I want to, in addition to saving the image, save a variet开发者_如何转开发y of thumbnails in both png and jpg format. To do this I am using the code below. The initial image uploads fine but then, after spinning for a moment I get an error of: "Request aborted due to heavy system load." (from my host crystaltech), and none of the thumbnails have made it through. I've tried it with even just one resize (and no converts) and it still fails. What am I doing wrong? This issue is somewhat urgent....Thanks!

`

       <cffile action="upload" destination="#Application.filePath#Icons\#app#Icon.png" filefield="Icon" nameconflict="overwrite">
                                    <cfimage source="#Application.filePath#Icons\#app#Icon.png" action="resize" width="50%" height="50%" destination="#Application.filePath#Icons\#app#Icon_Half.png" overwrite="yes"> 
                                    <cfimage source="#Application.filePath#Icons\#app#Icon.png" action="resize" width="25%" height="25%" destination="#Application.filePath#Icons\#app#Icon_Quarter.png" overwrite="yes">    
                                    <cfimage source="#Application.filePath#Icons\#app#Icon.png" action="convert" destination="#Application.filePath#Icons\#app#Icon.jpg">
                                    <cfimage source="#Application.filePath#Icons\#app#Icon_Half.png" action="convert" destination="#Application.filePath#Icons\#app#Icon_Half.jpg">
                                    <cfimage source="#Application.filePath#Icons\#app#Icon_Quarter.png" action="convert" destination="#Application.filePath#Icons\#app#Icon_Quarter.jpg">

`


I think that this is probably their default error message. It is possible you have hit, as @Dan suggested, a heap limit or a timeout. However, I'd guess that it is dying on the file conversion. You don't specify overwrite="yes", and if the image has already been processed, it's going to fail here.


first off: what version of CF is this and what is the JVM version it is running on?

reason is if it's CF8, there was a hotfix for the cfimage tag:

http://kb2.adobe.com/cps/403/kb403411.html

so i would make sure that they have that hotfix installed since it isn't included in CHF4:

http://kb2.adobe.com/cps/529/cpsid_52915.html

also, i've ran into issue with the JVM version that CF shipped with and using cfimage. updating the JVM to (at the time) 1.6.0_11 fixed the issue (can't remember exactly what the problem was). so i would make sure that you have at least that JVM version running.

now if this is CF9, that is a whole other story ;)


I figured out the issue. It turns out that CFIMAGE resize does not play well with transparent .png files. I just made it do the above starting with a .jpg file, and there were no problems whatsoever.

I was using CF 9 btw.

0

精彩评论

暂无评论...
验证码 换一张
取 消