Detecting GD version

From: Date: Mon, 14 Oct 2002 00:37:20 +0000
Subject: Detecting GD version
Groups: php.general 
Request: Send a blank email to php-general+get-119821@lists.php.net to get a copy of this message
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

« previous php.general (#119821) next »