RE: [PHP] GD GIF or PNG Detect Part 2
| From: | Daniel Reichenbach | Date: | Mon, 29 Oct 2001 13:18:34 +0000 |
| Subject: | RE: [PHP] GD GIF or PNG Detect Part 2 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72712@lists.php.net to get a copy of this message | ||
> However when there are no GD libraries installed the
> following error is
> thrown:
> Fatal error: Call to undefined function: imagetypes()
>
> Any suggestions to prevent the error message being thrown. Are there
> other methods to detect the presence GD libraries before
> testing for GIF
> or PNG support?
How about using something like this?
if (function_exists('ImageTypes')) {
// GD functions are available
} else {
// GD functions not available
}
http://www.php.net/manual/en/function.function-exists.php
is the place
in the manual :)
Daniel