Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to encode interlaced PNG format
- Loading branch information
1 parent
968f9e4
commit 490b8ae
Showing
6 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Intervention\Image\Tests\Traits; | ||
|
||
use Intervention\Image\Traits\CanBuildFilePointer; | ||
|
||
trait CanDetectInterlacedPng | ||
{ | ||
use CanBuildFilePointer; | ||
|
||
/** | ||
* Checks if the given image data is interlaced encoded PNG format | ||
* | ||
* @param string $imagedata | ||
* @return bool | ||
*/ | ||
private function isInterlacedPng(string $imagedata): bool | ||
{ | ||
$f = $this->buildFilePointer($imagedata); | ||
$contents = fread($f, 32); | ||
fclose($f); | ||
|
||
return ord($contents[28]) != 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters