Products
Services
Contact Us

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: (3357)
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)

dimensions = findDimensions(imageFile.Path, Width, Height, c, strType)

Response.Write("your Image width is: " & width & "<br>")
Response.Write("your image height is: " & height & "<br>" )

set fileObject=nothing
set imageFile=nothing

%>


Downloads
imageSpecifications.asp7.8 KB
 

See other Scripts in Asp file system

Submit Your Scripts:


System Message:
  • Your ASP & ASP.NET script has been sent. Please allow 48 hours for processing.


If you would like to have your ASP & ASP.NET scripts published in this section please fill out
the form below:
*Your Name or Username:
Home Town:
*Email:
*Description and Code:
*Enter Code shown
to the right:

[ Refresh Image ]