使用 CFImage 创建缩略图由于服务器负载而中止?

发布于 2024-08-25 14:26:59 字数 1381 浏览 4 评论 0原文

我正在通过表单上传图像,除了保存图像之外,我还想以 png 和 jpg 格式保存各种缩略图。为此,我使用下面的代码。初始图像上传正常,但旋转一会儿后,我收到错误:“由于系统负载过重,请求中止。” (来自我的主机 crystaltech),并且没有一个缩略图能够通过。我已经尝试过,即使只调整一次大小(并且没有转换),它仍然失败。我做错了什么?这个问题有点紧急....谢谢!

`

       <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 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">

`

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

榕城若虚 2024-09-01 14:26:59

我认为这可能是他们默认的错误消息。正如@Dan 建议的那样,您可能已经达到了堆限制或超时。但是,我猜它在文件转换过程中快要死了。你没有指定 overwrite="yes",如果图像已经被处理过,那么这里将会失败。

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.

西瑶 2024-09-01 14:26:59

首先:这是什么版本的 CF 以及它运行的 JVM 版本是什么?

原因是如果它是 CF8,则 cfimage 标签有一个修补程序:

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

所以我会确保他们安装了该修补程序,因为它不包含在 CHF4 中:

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

另外,我遇​​到了 JVM 版本的问题CF 附带并使用 cfimage。将 JVM 更新到(当时)1.6.0_11 修复了该问题(不太记得问题是什么)。所以我会确保您至少运行了该 JVM 版本。

现在,如果这是 CF9,那就完全是另外一个故事了;)

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

音栖息无 2024-09-01 14:26:59

我想通了这个问题。事实证明,CFIMAGE 调整大小不能很好地处理透明 .png 文件。我只是让它从 .jpg 文件开始执行上述操作,没有任何问题。

顺便说一句,我用的是CF 9。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文