summaryrefslogtreecommitdiff
path: root/core/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-05 23:29:44 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-05 23:29:44 +0000
commit04fe9da19036a657aeeee11f6c3641f98a345323 (patch)
treec69a9c93583d90842c4c03202a59129f104cac3b /core/helpers
parent7521465ec3af00b10d67880e780e6b60eba2b597 (diff)
Addressed the issues in ticket 34.
Surround the the attempt to use gd_info with a try catch block. Created a new class gInstalledToolkit which has the highlighting and the over pointer definition. Now if you mouse across an inactive toolkit it remains inert.
Diffstat (limited to 'core/helpers')
-rw-r--r--core/helpers/graphics.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php
index 9954bf22..cd112e1b 100644
--- a/core/helpers/graphics.php
+++ b/core/helpers/graphics.php
@@ -236,7 +236,12 @@ class graphics_Core {
* GraphicsMagick we return the path to the directory containing the appropriate binaries.
*/
static function detect_toolkits() {
- return array("gd" => function_exists("gd_info") ? gd_info() : array(),
+ try {
+ $gd = function_exists("gd_info") ? gd_info() : array();
+ } catch (Exception $e) {
+ $gd = array();
+ }
+ return array("gd" => $gd,
"imagemagick" => dirname(exec("which convert")),
"graphicsmagick" => dirname(exec("which gm")));
}