'函數名: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