diff options
author | Andrey Andreev <narf@devilix.net> | 2015-05-11 10:03:06 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-05-11 10:03:06 +0200 |
commit | fbde2798688ab99cfe3fdd22746d60f0877b2c27 (patch) | |
tree | 14591dc0aafd5cecddd5e6cec082443a419006d9 /system | |
parent | 70f738a14b0f6f70d9292c0f488ea423a76f438e (diff) |
Fix #3846
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Image_lib.php | 18 |
1 files changed, 12 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--; } } } |