February 25th, 2003, 11:15 PM
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!
March 4th, 2003, 09:29 PM
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
You could then put the results in some sort of web app that returns the values, using SOAP or XMLRPC
$imageInfo = getimagesize($filename);
$width = $imageInfo;
$height = $imageInfo;