1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 12:18:14 +01:00

added greyscale method

This commit is contained in:
Oliver Vogel 2013-01-27 12:40:45 +01:00
parent 514ba420bc
commit a6143438ab
2 changed files with 17 additions and 1 deletions

View File

@ -197,6 +197,16 @@ class Image
imagefilter($this->resource, IMG_FILTER_PIXELATE, $size, $advanced);
}
public function grayscale()
{
imagefilter($this->resource, IMG_FILTER_GRAYSCALE);
}
public function greyscale()
{
$this->grayscale();
}
public function reset()
{
$this->setProperties($this->dirname .'/'. $this->basename);

View File

@ -105,7 +105,13 @@ class ImageTest extends PHPUnit_Framework_Testcase
{
$img = $this->getTestImage();
$img->pixelate(20);
$img->save('public/pixels.jpg');
$this->assertInstanceOf('Intervention\Image\Image', $img);
}
public function testGreyscaleImage()
{
$img = $this->getTestImage();
$img->greyscale();
$this->assertInstanceOf('Intervention\Image\Image', $img);
}