Using ImagePNG in CAPTCHA helper
Using ImagePNG function, if ImageJPG not exists
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 74ab24f..36a5374 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -216,8 +216,22 @@
// Generate the image
// -----------------------------------
$img_url = rtrim($img_url, '/').'/';
- $img_filename = $now.'.jpg';
- ImageJPEG($im, $img_path.$img_filename);
+
+ if (function_exists('ImageJPEG'))
+ {
+ $img_filename = $now.'.jpg';
+ ImageJPEG($im, $img_path.$img_filename);
+ }
+ elseif (function_exists('ImagePNG'))
+ {
+ $img_filename = $now.'.png';
+ ImagePNG($im, $img_path.$img_filename);
+ }
+ else
+ {
+ return FALSE;
+ }
+
$img = '<img src="'.$img_url.$img_filename.'" style="width: '.$img_width.'; height: '.$img_height .'; border: 0;" alt=" " />';
ImageDestroy($im);