summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorET-NiK <kronstadtsky@bk.ru>2014-08-08 16:43:02 +0200
committerET-NiK <kronstadtsky@bk.ru>2014-08-08 16:43:02 +0200
commit6854f87c384b2bcf549b9040413052ed67c3038b (patch)
tree8fa4a9394fb7c4ef223e319bdfdd5eac3215d066
parent345478b8b746ac2e64def739a78b053eebc68c64 (diff)
Using ImagePNG in CAPTCHA helper
Using ImagePNG function, if ImageJPG not exists
-rw-r--r--system/helpers/captcha_helper.php18
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 17 insertions, 2 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 74ab24ffb..36a53749f 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -216,8 +216,22 @@ if ( ! function_exists('create_captcha'))
// 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);
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 3215ae226..c37215d2d 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -137,6 +137,7 @@ Release Date: Not Released
- Added *word_length* and *pool* options to allow customization of the generated word.
- Added *colors* configuration to allow customization for the *background*, *border*, *text* and *grid* colors.
- Added *filename* to the returned array elements.
+ - Using ImagePNG function, if ImageJPEG not exists.
- :doc:`Text Helper <helpers/text_helper>` changes include: