diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-06 09:30:32 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-06 09:30:32 +0000 |
commit | 393273eaef4798cb4d03c73c4853edfb5903608b (patch) | |
tree | 113c7c3c6ab468206c777997d73d9664c194fd2b /core/helpers | |
parent | fa1ccbd86d4eee9f6c798e7342aa6f303cd00729 (diff) |
Add graphics::Can() to let us determine whether the active toolkit
supports a given function. Right now it's hardcoded to support what
we know about GD.
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/graphics.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index 53cf01db..d36a2421 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -304,4 +304,19 @@ class graphics_Core { self::$init = 1; } + + /** + * Verify that a specific graphics function is available with the active toolkit. + * @param string $function the function name (eg rotate, resize) + * @return boolean + */ + function can($function) { + if (module::get_var("core", "graphics_toolkit") == "gd" && + $function == "rotate" && + !function_exists("imagerotate")) { + return false; + } + + return true; + } } |