English 中文(简体)
解码器无法解码输入
原标题:decoder cannot decode input
  • 时间:2011-05-28 21:46:25
  •  标签:
  • coldfusion

当用户上传大图像时,使用cfimage将图像缩小到一定大小时,我会返回此错误。它似乎只适用于较大的图像。较小的通过ok。我没有看到太多的帮助,仔细阅读谷歌/SO。。。

我正在运行cf8。这是代码,标记它失败的行:

 <cffile action="move" source="#imgVars.fileData#" destination="#imgVars.folder##imgVars.newFileUUID#.#listlast(imgVars.fileName,  . )#" />
  <cfset newFile = imgVars.folder &  /  & imgVars.newFileUUID &  .  & listlast(imgVars.filename,  . )>
  <cfif fileexists(newFile)>
   <cfimage action="read" source="#newFile#" name="imageToUpload"><!---FAILURE--->
   <cfif ImageGetHeight(imageToUpload) gt 800 or ImageGetWidth(imageToUpload) gt 600>
    <cfset ImageScaleToFit(imageToUpload, 800, 600, "bilinear")>
    <cfimage source="#imageToUpload#" action="write" destination="#newFile#" overwrite="yes">
   </cfif>
   <cfif ImageGetWidth(imageToUpload) gt 600>
    <cfset ImageScaleToFit(imageToUpload, 600, 600, "bilinear")>
    <cfimage source="#imageToUpload#" action="write" destination="#newFile#" overwrite="yes">
   </cfif>
 </cfif>
问题回答

尝试使用isImageFile()而不是fileExists()





相关问题
JQuery AJAX .load - flash chart doesnt load in IE

An IE issue has me completely stumped. I have a coldfusion page that uses JQuery s AJAX .load function to load in a new flash file that is generated by coldFusion s cfchart tag. This works completely ...

Best Coldfusion Library for OpenID [closed]

I am getting ready to start a project that requires using OpenID within Coldfusion 8. I have found a number of different options and was wondering what has worked the best, get s the most support, ...

Find ColdFusion Generated ID

Is there a way to find the elements generated by ColdFusion s <CFLayout> and <CFLayoutArea> tags? These tags: <cflayout type="tab" name="MyAccount"> <cflayoutarea name="...

ColdFusion COM error

I am upgrading from CF4.5 to CF8. Calls to COM dll s that used to work in version 4.5 now throw a "Complex object types cannot be converted to simple values.." error. The COM object has a few arrays ...

What s the best way to write engine-specific CFML code?

Sometimes it is necessary to write different code for Adobe ColdFusion vs Railo vs OpenBD, due to differences in implementation. Do people have a specific method that they use for this? For example, ...

热门标签