Re: Image size check

From: Date: Tue, 07 Nov 2000 20:59:31 +0000
Subject: Re: Image size check
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24193@lists.php.net to get a copy of this message
this works. maybe it'll help you. $img_size = GetImageSize("/html/images/images_products/jpegs/$img"); $img_size_w = $img_size[0] + 20; $img_size_h = $img_size[1] + 20; # write javascript image url $img = "<a href=\"javascript:popUP('/html/images/images_products/jpegs/$img','','width=$img_size_w,height=$img_size_h')\">image</a>"; At 11:27 AM 11/7/00 -0600, Matt McClanahan wrote:
On Tue, 7 Nov 2000, Abe wrote: I wonder if you can help, I seem to get an error with this script. I am using PHP 3.0.15 on Linux: (snip) Any ideas would be appreciated. ImageSX is one of the GD functions, which requires a pre-loaded image rather than a filename. http://www.php.net/manual/function.imagesx.php For example, <? $name = "/home/etc/etc/etc...../images/ptrs_on.gif"; $im = ImageCreateFromGif($name); $width = ImageSX($im); ?> One thing to note, this requires using a very old verison of GD to get gif support. Modern versions only support jpeg and png. Instead, you could use GetImageSize which doesn't need GD, and should still support gif, though I've never tried it myself. http://www.php.net/manual/function.getimagesize.php For example, <? $name = "/home/etc/etc/etc...../images/ptrs_on.gif"; $size = GetImageSize($name); echo "Image width: $size[0] <br> Image height: $size[1] <br>"; ?> Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#24193) next »