mirror of
https://github.com/Intervention/image.git
synced 2025-08-30 09:10:21 +02:00
added interlace method
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
@@ -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';
|
||||
|
Reference in New Issue
Block a user