Posted by bizt on 03/21/07 02:05
Hi,
Is it possible to obtain the width/ height of an image when that image
is dyanically created using a PHP script and passing GET attributes.
For example:
<img src="images/showImage.php?image_id=5" />
My images are created from images stored on the server, their paths
stored on in database table and retrieved using the GET image_id and
PHP script (showImage.php). Because the images are different sizes I
would like to be able to use a PHP function / class that can take an
image path and generate the IMG width and height attributes. This
would just tidy up the page when loading.
So when I try to use PHP 'getimagesize' like so:
$wh = getimagesize ($_SERVER['DOCUMENT_ROOT'] . "/images/showImage.php?
image_id=5");
.... I get an error saying that the file or directory does not exist:
Warning: getimagesize(/customersites/0/home/httpd/vhosts/
mydomain.co.uk/httpdocs/images/showImage.php?image_id=5): failed to
open stream: No such file or directory in /customersites/0/home/httpd/
vhosts/mydomain.co.uk/httpdocs/classes/html.class.php on line 11
I thin it may be the GET atttribute that is throwing it. How would I
go about doing this? Thanks
Burnsy
Navigation:
[Reply to this message]
|