-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lost transparency when converting to GIF format
- Loading branch information
1 parent
54aa51e
commit 50a16bb
Showing
4 changed files
with
49 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Intervention\Image\Tests\Feature\Gd; | ||
|
||
use Intervention\Image\ImageManager; | ||
use Intervention\Image\Tests\GdTestCase; | ||
|
||
class ConvertPngGif extends GdTestCase | ||
{ | ||
public function testConversionKeepsTransparency(): void | ||
{ | ||
$converted = ImageManager::gd() | ||
->read( | ||
$this->readTestImage('circle.png')->toGif() | ||
); | ||
|
||
$this->assertTransparency($converted->pickColor(0, 0)); | ||
$this->assertColor(4, 2, 4, 255, $converted->pickColor(25, 25), 4); | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Intervention\Image\Tests\Feature\Imagick; | ||
|
||
use Intervention\Image\ImageManager; | ||
use Intervention\Image\Tests\ImagickTestCase; | ||
|
||
class ConvertPngGif extends ImagickTestCase | ||
{ | ||
public function testConversionKeepsTransparency(): void | ||
{ | ||
$converted = ImageManager::imagick() | ||
->read( | ||
$this->readTestImage('circle.png')->toGif() | ||
); | ||
|
||
$this->assertTransparency($converted->pickColor(0, 0)); | ||
$this->assertColor(4, 2, 4, 255, $converted->pickColor(25, 25), 4); | ||
} | ||
} |