From be97bdc41601ead493287d67ac80cd5241ddc746 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 23 Mar 2008 16:24:37 +0000 Subject: Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226). --- system/plugins/captcha_pi.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'system/plugins') diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php index 693fd9117..7aa31efb1 100644 --- a/system/plugins/captcha_pi.php +++ b/system/plugins/captcha_pi.php @@ -244,7 +244,15 @@ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = // Create image // ----------------------------------- - $im = ImageCreate($img_width, $img_height); + // PHP.net recommends imagecreatetruecolor(), but it isn't always available + if (function_exists(imagecreatetruecolor)) + { + $im = imagecreatetruecolor($img_width, $img_height); + } + else + { + $im = imagecreate($img_width, $img_height); + } // ----------------------------------- // Assign colors -- cgit v1.2.3-24-g4f1b