Re: Image size check

From: Date: Tue, 07 Nov 2000 17:27:43 +0000
Subject: Re: Image size check
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24137@lists.php.net to get a copy of this message
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

« previous php.general (#24137) next »