1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-31 09:31:53 +02:00

Fix bug in CropModifier of Imagick driver (#1428)

The CropModifier produced strange artifacts if another resize step was performed after the modification.

This patch removes the copying of the alpha channel in the CropModifier and implements a different method.

See: https://github.com/Intervention/image/issues/1426
This commit is contained in:
Oliver Vogel
2025-02-01 08:28:26 +01:00
committed by GitHub
parent 629142e2de
commit 0f87254688
2 changed files with 46 additions and 20 deletions

View File

@@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace Intervention\Image\Tests\Feature\Imagick;
use Intervention\Image\Tests\ImagickTestCase;
class CropResizePngTest extends ImagickTestCase
{
public function testCropResizePng(): void
{
$image = $this->readTestImage('tile.png');
$image->crop(100, 100);
$image->resize(200, 200);
$this->assertTransparency($image->pickColor(7, 22));
$this->assertTransparency($image->pickColor(22, 7));
}
}