views:

144

answers:

3

I am uploading in image via a form and I want to, in addition to saving the image, save a variety 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">

`

+1  A: 

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.

Ben Doom
I tested it with just the resize and it died; so it wasn't the convert.
What happens if instead of resizing, you just try to read the image into a variable?
Ben Doom
+1  A: 

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 ;)

rip747
A: 

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.