mirror of
https://github.com/Intervention/image.git
synced 2025-01-29 09:47:36 +01:00
added pixelate method
This commit is contained in:
parent
130e95d267
commit
514ba420bc
@ -192,6 +192,11 @@ class Image
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function pixelate($size = 10, $advanced = true)
|
||||
{
|
||||
imagefilter($this->resource, IMG_FILTER_PIXELATE, $size, $advanced);
|
||||
}
|
||||
|
||||
public function reset()
|
||||
{
|
||||
$this->setProperties($this->dirname .'/'. $this->basename);
|
||||
|
@ -101,6 +101,14 @@ class ImageTest extends PHPUnit_Framework_Testcase
|
||||
|
||||
}
|
||||
|
||||
public function testPixelateImage()
|
||||
{
|
||||
$img = $this->getTestImage();
|
||||
$img->pixelate(20);
|
||||
$img->save('public/pixels.jpg');
|
||||
$this->assertInstanceOf('Intervention\Image\Image', $img);
|
||||
}
|
||||
|
||||
public function testResetImage()
|
||||
{
|
||||
$img = $this->getTestImage();
|
||||
@ -114,7 +122,7 @@ class ImageTest extends PHPUnit_Framework_Testcase
|
||||
|
||||
public function testSaveImage()
|
||||
{
|
||||
$save_as = 'public/test.jpg';
|
||||
$save_as = 'public/test2.jpg';
|
||||
$img = $this->getTestImage();
|
||||
$img->save($save_as);
|
||||
$this->assertFileExists($save_as);
|
||||
|
Loading…
x
Reference in New Issue
Block a user