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

Reply via email to