public static function isGdInstalled() { if (!isset(self::$isGdInstalled)) { self::$isGdInstalled = (extension_loaded('gd') || extension_loaded('gd2')) && function_exists('gd_info'); } return self::$isGdInstalled; }