Forum Moderators: coopster

Message Too Old, No Replies

Get image size

...from a dynamic image

         

Bonusbana

9:07 pm on May 20, 2004 (gmt 0)

10+ Year Member



Hi

I have a page that generates a dynamic button like:

button.php?text=button

Now, from my html page I would like to add the image like: <img src="image.php?text=button" />

This works fine, but then I try to use the getimagesize function like:

function displayButton($text) {
list($width, $height, $type, $attr) = getimagesize("image.php?text=$text");
echo "<img src=\"image.php?text=$text\" $attr />";
}

when I try to do a <?php displayButton("button");?> I get a warning about the image not existing or wrong path.

My question is: is it possible to get the height & width attributes from a dynamic image?

thanx

bakedjake

9:09 pm on May 20, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Use a canonical URL for your path in getimagesize.