Sample code to resize an image with ASPJpeg 1.6. User will need to customize the imagePath and image_name variables. See comments in code.
Code Sample
1 <HTML>
2 <HEAD>
3 <%
4 ' Path and name to the location of the image file
5 imagePath = "/images"
6 image_name = "clock.jpg"
7
8 ' Name of the resized image file
9 new_image_filename = "clock_small.jpg"
10
11 ' Create instance of AspJpeg
12 Set Jpeg = Server.CreateObject("Persits.Jpeg")
13
14 ' Compute path to source image
15 Path = Server.MapPath(imagePath & "/" & image_name)
16
17 ' Open source image
18 Jpeg.Open Path
19
20 ' Decrease image size by 50%
21 Jpeg.Width = Jpeg.OriginalWidth / 2
22 Jpeg.Height = Jpeg.OriginalHeight / 2
23
24 ' Apply sharpening if necessary
25 Jpeg.Sharpen 1, 130
26
27 ' create thumbnail and save it to disk
28 Jpeg.Save Server.MapPath(imagePath & "/" & new_image_filename)
29 %>
30
31 Original Image:<BR>
32 <IMG src="