Home What's New
User Manual
|
Chapter 7. Image Handling
Image Size and Type Extraction
The property File.ImageType
returns the strings "GIF", "JPG", "BMP", "PNG"
(for GIF JPEG BMP and PNG images, respectively), or "UNKNOWN"
if the file is not an image or of an unknown image type.
The properties File.ImageWidth and File.ImageHeight
return the image width and height in pixels, or 0
if the file is not an image.
The code samples size.asp and size_upload.asp
demonstrate the usage of these properties.
<HTML>
' Capture and save uploaded image
For Each File in Upload.Files
Response.Write File.Path & "<BR>"
Click the link below to run this code sample:
The code samples resize.asp and resize_upload.asp
demonstrate how AspJpeg can be used to resize a newly uploaded JPEG
image. The uploaded and resized images are saved in the same directory
as the ASP scripts, rather than the usual c:\upload folder,
to be able to display both images in the browser easily.
' Use AspJpeg to resize image
' Capture and save uploaded image to the same directory as script
For Each File in Upload.Files
Jpeg.Open File.Path
Scale = Upload.Form("Scale")
Click the link below to run this code sample:
http://localhost/aspupload/07_image/resize.asp
AspJpeg comes with many more code samples.
A live demo is also available.
Copyright © 1998 - 2001 Persits Software, Inc. All Rights Reserved AspUpload® is a registered trademark of Persits Software, Inc. Questions? Comments? Write us! |