summaryrefslogtreecommitdiffstats
path: root/system/libraries/Image_lib.php
diff options
context:
space:
mode:
authorAhmad Anbar <aanbar@gmail.com>2015-05-17 12:20:34 +0200
committerAhmad Anbar <aanbar@gmail.com>2015-05-17 12:20:34 +0200
commit57940dedcaab05f2dc392b2757cb3d58c59274c9 (patch)
tree1783dc5a17cc20ddede409e13984576bff274302 /system/libraries/Image_lib.php
parent5e50c42ef27261bc7fcb279499ce76cfc2519aa6 (diff)
parent3a9eb39f61b10b3f86e50f4cd39ca0d9f010bac2 (diff)
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'system/libraries/Image_lib.php')
-rw-r--r--system/libraries/Image_lib.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index e056654bb..ce6c42b02 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 < $bottom)
{
$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--;
}
}
}