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

    Join Date
    Feb 2003
    Posts
    15
    Rep Power
    0

    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!

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

    Join Date
    Feb 2003
    Posts
    138
    Rep Power
    12
    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:
    $filename=imagepath
    $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
    --

    ngibsonau

IMN logo majestic logo threadwatch logo seochat tools logo