'函数名:isobjinstalled
'作 用:检查组件是否已经安装
'参 数:strclassstring ----组件名
'返回值:true ----已经安装
' false ----没有安装
function isobjinstalled(strclassstring)
on error resume next
isobjinstalled = false
err = 0
dim xtestobj
set xtestobj = server.createobject(strclassstring)
if 0 = err then isobjinstalled = true
set xtestobj = nothing
err = 0
end function
'缩略图函数
function jpegsmall(originalpic,s_opic,sp)
dim jpeg,picpath,smallpathpic
if originalpic = "" or isnull(originalpic) then
jpegsmall = ""
else
if isobjinstalled("persits.jpeg") then
set jpeg = server.createobject("persits.jpeg")
opicpath = s_opic
picpath = server.mappath(originalpic)
smallpathpic = server.mappath(opicpath)
jpeg.open picpath
jpeg.width = jpeg.originalwidth / sp
jpeg.height = jpeg.originalheight / sp
jpeg.save smallpathpic
jpeg.close:set jpeg = nothing
jpegsmall = s_opic
else
jpegsmall = ""
end if
end if
end function