1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-30 01:00:06 +02:00

added interlace method

This commit is contained in:
Oliver Vogel
2013-12-10 16:52:22 +01:00
parent 2f1a10ef0a
commit 207010c76f
2 changed files with 24 additions and 0 deletions

View File

@@ -1352,6 +1352,19 @@ class Image
return $this;
}
/**
* Determine whether an Image should be interlaced
*
* @param boolean $interlace
* @return Image
*/
public function interlace($interlace = true)
{
imageinterlace($this->resource, $interlace);
return $this;
}
/**
* Reset to original image resource
*

View File

@@ -1389,6 +1389,17 @@ class ImageTest extends PHPUnit_Framework_Testcase
$this->assertEquals($color2['a'], 1);
}
public function testInterlaceImage()
{
$img = Image::make('public/trim.png');
$img->interlace();
$contents = $img->encode();
$this->assertEquals(( ord($contents[28]) != '0' ), true);
$img->interlace(false);
$contents = $img->encode();
$this->assertEquals(( ord($contents[28]) != '0' ), false);
}
public function testSaveImage()
{
$save_as = 'public/test2.jpg';