Scripts: asp :: ASP File System :: Library Article #2
Developer's Section
Get Image Dimensions in ASP By: Erobo Team Member
Hire a Developer for Related Work / Installation | $55 hr
Rating: | Rate It:
Average Votes: (3397)
Favorites:
Get dimensions of an image using ASP
This article shows how to get the dimensions of any .gif or .jpeg image file.
You will need the file: imageSpecifications.asp to use this script (the file is provided in the downloads box of this article).
Code Snippet 1
<!--#include file='imageSpecifications.asp'-->
<%
Dim fileObject
Dim imageFile
Dim imagePath
Dim width 'image width
Dim height 'image height
Dim strType 'image type
Dim c 'additional information
Set fileObject =Server.CreateObject("Scripting.FileSystemObject")
'make sure you get the full path of the image
imagePath = Server.Mappath("files/myImage.jpg")
Set imageFile = fileObject.GetFile(imagePath)