0
当用户上传大图像时,使用cfimage缩小图像的大小时出现此错误。它似乎只投射更大的图像。小的通过确定。我还没有看到这个问题,看到谷歌/ 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>