AspJpeg is a high-quality image thumbnail component that can resize images on-the-fly. Features include:
* Supports JPEG, GIF, BMP, TIFF and PNG formats. Output format is always JPEG.
* Source images can be opened from disk, memory, or a recordset.
* Resized images can be saved to disk, memory or an HTTP stream.
* Supports three resizing algorithms: nearest-neighbor, bilinear, and bicubic.
* Drawing and typing on top of an image. Support for TrueType and Type 1 fonts.
* Automatic word wrapping, text alignment to the left, right, center and justified, rotation.
* Picture-in-picture support.
* Cropping, flipping, rotation, sharpening, grayscale conversion.
* Compression rate of output images can be adjusted for optimal quality/file size ratio.
* EXIF and IPTC metadata extraction from JPEG images.
* CMYK-to-RGB conversion.
* Sepia filter.
* Read/write access to individual pixels of an image.
* PNG alpha channel support.
* GIF transparency support.
* Brightness, contrast and saturation adjustment.
More information:
For more information:
http://www.aspjpeg.com
For Live Demo:
http://www.aspjpeg.com/livedemo.html
Sample code to resize an image with ASPJpeg 1.8.
You will need to customize the imagePath and image_name variables. See comments in code.
| <HTML> |
| <HEAD> |
| <TITLE>AspJpeg - Simple.asp</TITLE> |
| </HEAD> |
| <BODY> |
| |
| <% |
| |
| ' Path and name to the location of the image file |
| imagePath = "/images" |
| image_name = "images.jpg" |
| |
| ' Name of the resized image file |
| new_image_filename = "clock_small.jpg" |
| |
| ' Create instance of AspJpeg |
| Set Jpeg = Server.CreateObject("Persits.Jpeg") |
| |
| ' Compute path to source image |
| Path = Server.MapPath(imagePath & "/" & image_name) |
| |
| ' Open source image |
| Jpeg.Open Path |
| |
| ' Decrease image size by 50% |
| JpegJpeg.Width = Jpeg.OriginalWidth / 2 |
| JpegJpeg.Height = Jpeg.OriginalHeight / 2 |
| |
| ' Apply sharpening if necessary |
| Jpeg.Sharpen 1, 130 |
| |
| ' create thumbnail and save it to disk |
| Jpeg.Save Server.MapPath(imagePath & "/" & new_image_filename) |
| %> |
| |
| Original Image:<BR> |
| <IMG SRC="<%=imagePath & "/" & image_name%>"><P> |
| |
| Thumbnail (50% reduction):<BR> |
| <IMG SRC="<%=imagePath & "/" & new_image_filename%>"><P> |
| |
| <% |
| Response.Write "<HR>AspJpeg expires on " & Jpeg.Expires |
| %> |
| |
| </BODY> |
| </HTML> |
Article ID: 186, Created: August 6, 2012 at 11:46 PM, Modified: August 6, 2012 at 11:46 PM