You are here: How do I get the image height width when generating image from PHP (getimagesize does seem to work) « PHP Programming Language « IT news, forums, messages
How do I get the image height width when generating image from PHP (getimagesize does seem to work)

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация