note 45014 added to function.imagecreatetruecolor
| From: | ernst at baschny dot de | Date: | Mon, 23 Aug 2004 12:38:17 +0000 |
| Subject: | note 45014 added to function.imagecreatetruecolor | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-75161@lists.php.net to get a copy of this message | ||
Depending on the PHP version you might need to perform different type of checks to see if this
function is supported. Here is a list of how different PHP releases behave:
4.0.6 and 4.1.x: The function is always defined if the GD-module (any version!) is loaded. If called
without having GD2.0, will return a "Fatal error" (and abort your script). No way to
handle this
4.2.x: The function is always defined if the GD-module is loaded. If called without having GD2.0,
will generate a PHP "Warning", your script will go on (without a valid resource)
4.3.x: The function is *only* defined if you have compiled PHP with GD2.0 and this module is loaded.
Here you have the easiest method to detect if it works (function_exists).
Unfortunately, if you want to support 4.0.6, 4.1.x and 4.2.x you *will* have to check for current
PHP-version and GD-version instead of relying on function_exists().
----
Manual Page -- http://www.php.net/manual/en/function.imagecreatetruecolor.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45014
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45014&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45014&report=yes
Search -- http://master.php.net/manage/user-notes.php