#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    17
    Rep Power
    0

    Probably a dumb question


    But who knows? ^ ~

    In internet explorer when you right click on an image and choose properties, the browser can then tell you the dimensions of the image you are asking about.

    My question is can you retrieve that information from an image for use in scripting? Like is there an image.width attribute I can call to in order to get the width of an image, or something like that.

    If there is such a way to get dimensions, I'd love to be shown how to retrieve it. *hint hint*

    Thanks in advance ^^
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Seattle, WA
    Posts
    7
    Rep Power
    0

    GetImageSize() function


    From the php.net website:

    The GetImageSize() function will determine the size of any GIF, JPG, PNG or SWF image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag.

    Returns an array with 4 elements. Index 0 contains the width of the image in pixels. Index 1 contains the height. Index 2 a flag indicating the type of the image. 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF. Index 3 is a text string with the correct "height=xxx width=xxx" string that can be used directly in an IMG tag.


    Check out http://www.php.net/manual/en/function.getimagesize.php
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    17
    Rep Power
    0
    Beautiful, thanks.

IMN logo majestic logo threadwatch logo seochat tools logo