mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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
This commit is contained in:
parent
4b12d00697
commit
23044a94dd
@ -352,8 +352,8 @@ class GD extends Object {
|
|||||||
$rr = ($rv == 0) ? 0 : 1/($rt/$rv);
|
$rr = ($rv == 0) ? 0 : 1/($rt/$rv);
|
||||||
$br = ($bv == 0) ? 0 : 1/($rt/$bv);
|
$br = ($bv == 0) ? 0 : 1/($rt/$bv);
|
||||||
$gr = ($gv == 0) ? 0 : 1/($rt/$gv);
|
$gr = ($gv == 0) ? 0 : 1/($rt/$gv);
|
||||||
for($dy = 0; $dy <= $height; $dy++) {
|
for($dy = 0; $dy < $height; $dy++) {
|
||||||
for($dx = 0; $dx <= $width; $dx++) {
|
for($dx = 0; $dx < $width; $dx++) {
|
||||||
$pxrgb = imagecolorat($this->gd, $dx, $dy);
|
$pxrgb = imagecolorat($this->gd, $dx, $dy);
|
||||||
$heightgb = ImageColorsforIndex($this->gd, $pxrgb);
|
$heightgb = ImageColorsforIndex($this->gd, $pxrgb);
|
||||||
$newcol = ($rr*$heightgb['red']) + ($br*$heightgb['blue']) + ($gr*$heightgb['green']);
|
$newcol = ($rr*$heightgb['red']) + ($br*$heightgb['blue']) + ($gr*$heightgb['green']);
|
||||||
|
Loading…
Reference in New Issue
Block a user