mirror of
https://github.com/Intervention/image.git
synced 2025-08-31 17:41:58 +02:00
Fix lost transparency when converting to GIF format
This commit is contained in:
22
tests/Feature/Gd/ConvertPngGif.php
Normal file
22
tests/Feature/Gd/ConvertPngGif.php
Normal file
@@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user