网站程序不能生成缩略图,求助

来源:百度知道 编辑:UC知道 时间:2024/06/09 17:54:36
我有个网站的程序不能生成缩略图,可是我对代码不太懂,请大家帮我看看哪出错了,我把我觉得不对的代码发上来,请大家帮忙分析一下 我的QQ283524771 大家也可以Q我,谢谢了

' Author : henry lu
' 生成缩略图,参数:源图路径,目标图路径,宽度,高度,是否裁剪标记:0否,1是
Function SaveThumbPic(ByVal strSrcImagePath, ByVal strDstImagePath, _
ByVal intMaxWidth, ByVal intMaxHeight, ByVal intCropFlag)
Dim Jpeg,fs,FilePath
Dim intImageWidth, intImageHeight
Dim intThumbWidth, intThumbHeight

On Error Resume Next

if instr(strSrcImagePath,":")<>2 then strSrcImagePath=Server.MapPath(strSrcImagePath)
if instr(strDstImagePath,":")<>2 then strDstImagePath=Server.MapPath(strDstImagePath)

'默认长宽是0
if intMaxWidth="" or not isNumeric(intMaxWidth) then intMaxWidth=0
if intMaxHeight="" or not isNumeric(intMaxHeight) then intMaxHeight=0

intMaxWidth=cint(intMaxWidth)
intMaxHeight=cint(intMaxHeight)
'长宽中有一项省略时,取另一项的值
if intMaxWidt

重发一下代码,刚才发的不全

' Author : henry lu
' 生成缩略图,参数:源图路径,目标图路径,宽度,高度,是否裁剪标记:0否,1是
Function SaveThumbPic(ByVal strSrcImagePath, ByVal strDstImagePath, _
ByVal intMaxWidth, ByVal intMaxHeight, ByVal intCropFlag)
Dim Jpeg,fs,FilePath
Dim intImageWidth, intImageHeight
Dim intThumbWidth, intThumbHeight

On Error Resume Next

if instr(strSrcImagePath,":")<>2 then strSrcImagePath=Server.MapPath(strSrcImagePath)
if instr(strDstImagePath,":")<>2 then strDstImagePath=Server.MapPath(strDstImagePath)

'默认长宽是0
if intMaxWidth="" or not isNumeric(intMaxWidth) then intMaxWidth=0
if intMaxHeight="" or not isNumeric(intMaxHeight) then intMaxHeight=0

intMaxWidth=cint(intMaxWidth)
intMaxHeight=cint(intMaxHeight)
'长宽中有一项省略时,取另一项的值
if intMaxWidth=0 then intMaxWidth=intMaxHeight
if intMaxHeight=0 then intMaxHei