1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-01 09:52:59 +02:00

Add ability to read Imagick or GDImage directly (#1329)

This commit is contained in:
Oliver Vogel
2024-04-10 15:17:36 +02:00
committed by GitHub
parent 2439fd80cb
commit 6e104b6594
11 changed files with 44 additions and 6 deletions

View File

@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Intervention\Image\Tests\Unit\Drivers\Imagick;
use Imagick;
use ImagickPixel;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
@@ -34,6 +36,15 @@ final class InputHandlerTest extends BaseTestCase
$this->assertInstanceOf(Image::class, $result);
}
public function testHandleImagick(): void
{
$imagick = new Imagick();
$imagick->newImage(3, 2, new ImagickPixel('rgba(255, 255, 255, 255)'), 'png');
$handler = new InputHandler();
$result = $handler->handle($imagick);
$this->assertInstanceOf(Image::class, $result);
}
public function testHandleSplFileInfo(): void
{
$handler = new InputHandler();