From fbde2798688ab99cfe3fdd22746d60f0877b2c27 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 May 2015 11:03:06 +0300 Subject: Fix #3846 --- system/libraries/Image_lib.php | 18 ++++++++++++------ user_guide_src/source/changelog.rst | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index e056654bb..6374aacdd 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -1055,8 +1055,11 @@ class CI_Image_lib { if ($this->rotation_angle === 'hor') { - for ($i = 0; $i < $height; $i++, $left = 0, $right = $width-1) + for ($i = 0; $i < $height; $i++) { + $left = 0; + $right = $width - 1; + while ($left < $right) { $cl = imagecolorat($src_img, $left, $i); @@ -1072,18 +1075,21 @@ class CI_Image_lib { } else { - for ($i = 0; $i < $width; $i++, $top = 0, $bot = $height-1) + for ($i = 0; $i < $width; $i++) { - while ($top < $bot) + $top = 0; + $bottom = $height - 1; + + while ($top < $botttom) { $ct = imagecolorat($src_img, $i, $top); - $cb = imagecolorat($src_img, $i, $bot); + $cb = imagecolorat($src_img, $i, $bottom); imagesetpixel($src_img, $i, $top, $cb); - imagesetpixel($src_img, $i, $bot, $ct); + imagesetpixel($src_img, $i, $bottom, $ct); $top++; - $bot--; + $bottom--; } } } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 2d10f8f96..185a17af4 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -27,6 +27,7 @@ Bug fixes for 3.0.1 - Fixed a bug (#3801) - :doc:`Output Library ` method ``_display_cache()`` incorrectly looked for the last modified time of a directory instead of the cache file. - Fixed a bug (#3816) - :doc:`Form Validation Library ` treated empty string values as non-existing ones. - Fixed a bug (#3823) - :doc:`Session Library ` drivers Redis and Memcached didn't properly handle locks that are blocking the request for more than 30 seconds. +- Fixed a bug (#3846) - :doc:`Image Manipulation Library ` method `image_mirror_gd()` didn't properly initialize its variables. Version 3.0.0 ============= -- cgit v1.2.3-24-g4f1b