From 393273eaef4798cb4d03c73c4853edfb5903608b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 6 Jan 2009 09:30:32 +0000 Subject: 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. --- core/helpers/graphics.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/helpers') 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; + } } -- cgit v1.2.3