From 639ba48a07235f09efb8458fa7ca87617b048fa4 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 27 Oct 2024 19:49:39 +0100 Subject: [PATCH] Adapt --- tests/Unit/HeicTest.php | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/Unit/HeicTest.php b/tests/Unit/HeicTest.php index 45a62eda..aa2b8f46 100644 --- a/tests/Unit/HeicTest.php +++ b/tests/Unit/HeicTest.php @@ -5,20 +5,34 @@ namespace Intervention\Image\Tests\Unit; use Intervention\Image\Tests\BaseTestCase; -use Intervention\Image\Encoders\MediaTypeEncoder; use Imagick; -use Intervention\Image\ImageManager; +use ImagickPixel; final class HeicTest extends BaseTestCase { public function testEncoding(): void { - $manager = ImageManager::imagick(); - $input = $manager->create(100, 100)->encode(new MediaTypeEncoder('image/heic')); + // create + $background = new ImagickPixel('rgba(255, 255, 255, 0)'); + $imagick = new Imagick(); + $imagick->newImage(100, 100, $background, 'png'); + $imagick->setType(Imagick::IMGTYPE_UNDEFINED); + $imagick->setImageType(Imagick::IMGTYPE_UNDEFINED); + $imagick->setColorspace(Imagick::COLORSPACE_SRGB); + $imagick->setImageResolution(96, 96); + $imagick->setImageBackgroundColor($background); + // encode + $imagick->setFormat('HEIC'); + $imagick->setImageFormat('HEIC'); + $imagick->setCompressionQuality(75); + $imagick->setImageCompressionQuality(75); + $encoded = $imagick->getImagesBlob(); + // re-read $imagick = new Imagick(); - $imagick->readImageBlob($input->toString()); + $imagick->readImageBlob($encoded); + $this->assertInstanceOf(Imagick::class, $imagick); } }