From 23044a94ddf65c67ed2704b5f190b0d5b21fd1bb Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Wed, 8 Apr 2009 03:21:07 +0000 Subject: [PATCH] BUGFIX: fixed issue with greyscale GD - patch from camspiers git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@74272 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- filesystem/GD.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filesystem/GD.php b/filesystem/GD.php index 43c0afa97..d71079c92 100755 --- a/filesystem/GD.php +++ b/filesystem/GD.php @@ -352,8 +352,8 @@ class GD extends Object { $rr = ($rv == 0) ? 0 : 1/($rt/$rv); $br = ($bv == 0) ? 0 : 1/($rt/$bv); $gr = ($gv == 0) ? 0 : 1/($rt/$gv); - for($dy = 0; $dy <= $height; $dy++) { - for($dx = 0; $dx <= $width; $dx++) { + for($dy = 0; $dy < $height; $dy++) { + for($dx = 0; $dx < $width; $dx++) { $pxrgb = imagecolorat($this->gd, $dx, $dy); $heightgb = ImageColorsforIndex($this->gd, $pxrgb); $newcol = ($rr*$heightgb['red']) + ($br*$heightgb['blue']) + ($gr*$heightgb['green']);