cAspImage
Version 1.0
cAspImage is a vbscript class that lets you read various properties from image files, including width, height and color depth. This cannot be done directly with ASP/vbscript because this type of information has to be parsed out from the image file itself.
Supported file formats are PNG, GIF, BMP and JPG.
How to use this class:
Dim oAspImg
Dim bSuccess
Set oAspImg = New cAspImage
With oAspImg
bSuccess = .ReadImage(Server.MapPath("some.gif"))
Response.Write "ImageSize: " & .ImageSize
Response.Write "Date Created: " & .DateCreated
Response.Write "Date Last Modified: " & .DateLastModified
Response.Write "ColorDepth: " & .ColorDepth
Response.Write "Width: " & .Width
Response.Write "Height: " & .Height
Response.Write "ImageType: " & .ImageType
If Not bSuccess Then Response.Write "Error Message: " & .ErrorMessage
End With
Set oAspImg = Nothing
Methods:
| Method | Returns | Description |
| Boolean | Returns properties of the image.b = Object.ReadImage(FilePath) |
Properties:
| Property | Returns | Description |
| Long | Image size in bytes.lngImageSize = Object.ImageSize |
|
| String | Date created.sDateCreated = Object.DateCreated |
|
| String | Date last modified.sDateLastModified = Object.DateLastModified |
|
| Integer | Bits per pixeliColorDepth = Object.ColorDepth |
|
| Long | Image width in pixels.lngWidth = Object.Width |
|
| Long | Image height in pixels.lngHeight = Object.Height |
|
| String | PNG, GIF87a or GIF89a, BMP or JPG.sImageType = Object.ImageType |
|
| String | Error message.sErrMsg = Object.ErrorMessage |
REQUIREMENTS:
You need a web server running ASP (Active Server Pages) with Microsoft Data Access Components installed.
PRICING:
FREE.
DOWNLOAD:
cAspImage.txt ~ 9KB
