<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><% 
Response.Expires = 0

Pic = Request.QueryString("p")
PointX = CInt(Request.QueryString("x"))
PointY = CInt(Request.QueryString("y"))
CutWidth = CInt(Request.QueryString("w"))
CutHeight = CInt(Request.QueryString("h"))
PicWidth = CInt(Request.QueryString("pw"))
PicHeight = CInt(Request.QueryString("ph"))

Set Jpeg = Server.CreateObject("Persits.Jpeg")
Jpeg.Open Server.MapPath(Pic)

img_w=PicWidth/Jpeg.OriginalWidth
img_h=PicHeight/Jpeg.OriginalHeight

Jpeg.Crop PointX/img_w, PointY/img_h, CutWidth/img_w + PointX/img_w, CutHeight/img_h + PointY/img_h

Jpeg.Width = 368
Jpeg.Height = 265

'Set Jpeg2=Server.CreateObject("Persits.Jpeg")
'Jpeg2.Open Server.MapPath("/logo/logo.gif")
'Jpeg.DrawImage 258,231,Jpeg2,0.5,100

Jpeg.Quality=100 
Jpeg.Save Server.MapPath(Pic) 
Set Jpeg=Nothing
Response.Write "<script>window.opener.document.getElementById(""infoimgurl"").value='"&Pic&"';window.close()</script>"
%>