1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Rep Power

    getting dimensions of remote images

    for my forum, i'd like users to be able post pictures, but of course, this can create layout problems if large pictures are used. they won't be able to upload pictures, they'll just be able to provide links to pictures already on the web. so here is my question:

    how can i EASILY obtain the height and width dimensions of a remote image file? i need a solution that doesn't involve extra components. i've found one or two solutions, and the one i tried works okay, but i can't figure out how to isolate the height and width. ideally, i'd like to be able to use a function with a web address as a parameter, which returns the height and width of the picture.

    any code or direction would be very much appreciated!

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Rep Power
    If you want to do it in ASP you need to make or find a COM object that will return the image dimensions

    in PHP you can use

    PHP Code:
    $imageInfo getimagesize($filename); 
    $width $imageInfo[0]; 
    $height $imageInfo[1]; 
    You could then put the results in some sort of web app that returns the values, using SOAP or XMLRPC


IMN logo majestic logo threadwatch logo seochat tools logo