' Function name: isobjinstalled
' Function: Check if the component is installed
' parameter: strclassstring----Component Name
' Return value: true----already installed
' False----not installed
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
' Thumbnail 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