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); } }