AspJpeg feature Settings
Set Jpeg = Server.CreateObject ("Persits.jpeg")
' Get Source picture path
Path = Server.MapPath ("uploadimages/") & "/" &filename
' Open the source picture
Jpeg.open Path
' Create thumbnail details There are a number of ways to set this up. The following method is to determine the aspect ratio and then scale
If jpeg.originalwidth/jpeg.originalheight > 1 Then
Jpeg.width = 98
jpeg.height = Int ((98/jpeg.originalwidth) *jpeg.originalheight)
ElseIf
Jpeg.originalwidth/jpeg.originalheight < 1 Then
Jpeg.height = 98
jpeg.width= Int (jpeg.originalwidth* (98/jpeg.height))
End If
' Set sharpening effect
Jpeg.sharpen 1, 130
' Generate thumbnails to the specified path
jpeg.save Server.MapPath ("uploadimages/") & "/small" &filename
' Note that these two sessions
Session ("PPP0") =gp_curpath&filename
Session ("PPP1") =gp_curpath& "small" &filename
Simpler generation of thumbnails
Set Jpeg = Server.CreateObject ("persits.jpeg") ' Create instance
Path = Server.MapPath (Blogpath & "/upload/" & FileName) ' Process picture path
Jpeg.open Path ' Open picture
' Adjust width and height to the original 50%, or you can write a fixed number of digits directly
jpeg.width = JPEG.ORIGINALWIDTH/2
Jpeg.height = JPEG.ORIGINALHEIGHT/2
Jpeg.save Server.MapPath (Blogpath & "/upload/" & FileName) ' Save pictures to disk
Jpeg.Close:Set Jpeg =
Nothing