try function_exists('imagecopyresampled'); otherwise I'm sure there has to be some function that returns versions of libs.
Andrew ----- Original Message ----- From: "Owen Prime" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 14, 2002 1:37 AM Subject: [PHP] Detecting GD version > Has anyone got any better ideas about how to detect what version of GD is > running other than the following. The reason I ask is that I want to use > imagecopyresampled() only if available ie. GD >= v2.0. > > OPTION 1. > Parse phpinfo() output for the GD version info. Expensive. > > OPTION 2. > Run imagecopyresampled() suppressing errors and then check the error msg. > ie: > @imagecopyresampled(); > if ($php_errormsg != "imagecopyresampled(): requires GD 2.0 or later") > // GD >= v2.0 > } else { > // GD < v2.0 > } > > Option 2 is the best I can come up with at the moment.... luckily the > "requires GD 2.0" error message is triggered before the argument validation > errors. > > Anyone got a better idea? > > Thanks, > > Owen Prime > http://www.noggin.com.au > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php