Using ServerObjects ImageSize
Posted by Paul Woodland (Import) on 02 December 2006 04:35 AM

ServerObjects ImageSize is a small utility for calculating the dimensions of images.

How do you use ServerObjects ImageSize?
The following is an example of using the ImageSize component to print the size of an image.

        'Create an instance of our ImageSize object.
        Set imageObj = Server.CreateObject("ImgSize.Check")

        'Select a local image.
        imageObj.FileName = Server.MapPath(".") & "\test.jpg"

        'We need to check for errors, or print its dimensions.
        If (imageObj.Error = "") Then
            Response.Write "Height: " & imageObj.Height & "<br />"
            Response.Write "Width: " & imageObj.Width
            Response.Write "Error: " & imageObj.Error
        End If

(332 vote(s))
Not helpful

Comments (0)