note 45014 rejected from function.imagecreatetruecolor by simp

From: Date: Wed, 05 Oct 2005 14:36:41 +0000
Subject: note 45014 rejected from function.imagecreatetruecolor by simp
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-96442@lists.php.net to get a copy of this message
Note Submitter: ernst at baschny dot de ---- 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().

« previous php.notes (#96442) next »