<% Response.Expires = 0 Response.Buffer = TRUE Response.Clear Dim newJpeg Set newJpeg = Server.CreateObject("Persits.Jpeg") Response.ContentType = "image/gif" newJpeg.Open Server.MapPath(Request("path")) new_width=CInt(request("w")) new_height=CInt(request("h")) wm=request("wm") If new_width>new_height Then current_ratio=new_height/new_width new_ratio=newJpeg.Height/newJpeg.Width If current_ratio>new_ratio Then newJpeg.Height=new_height newJpeg.Width = newJpeg.OriginalWidth * newJpeg.Height / newJpeg.OriginalHeight Else newJpeg.Width=new_width newJpeg.Height = newJpeg.OriginalHeight * newJpeg.Width / newJpeg.OriginalWidth End If diff=(newJpeg.Width-new_width)/2 newJpeg.Crop diff,0, new_width+diff,new_height Else current_ratio=new_width/new_height new_ratio=newJpeg.Width/newJpeg.Height If current_ratio "" Then ' If wm = "1" Then ' newJpeg.Canvas.Font.Color = &HFF0000 ' Red ' newJpeg.Canvas.Font.Family = "Arial" ' newJpeg.Canvas.Font.Bold = True ' newJpeg.Canvas.Font.Size = 95 ' newJpeg.Canvas.Print 10, 40, "SOLD" ' ElseIf wm = "2" Then ' newJpeg.Canvas.Font.Color = &HFF0000 ' Red ' newJpeg.Canvas.Font.Family = "Arial" ' newJpeg.Canvas.Font.Bold = True ' newJpeg.Canvas.Font.Size = 190 ' newJpeg.Canvas.Print 8, 65, "SOLD" ' End If 'End If newJpeg.SendBinary Set newJpeg =Nothing Response.End %>