mirror of
https://github.com/Intervention/image.git
synced 2025-08-31 01:29:51 +02:00
Fix bug with overlapping colors in ResizeCanvasModifier (#1394)
This commit is contained in:
@@ -40,6 +40,20 @@ final class ResizeCanvasModifierTest extends ImagickTestCase
|
||||
$this->assertColor(180, 224, 0, 255, $image->pickColor(2, 2));
|
||||
$this->assertColor(255, 255, 0, 255, $image->pickColor(17, 17));
|
||||
$this->assertTransparency($image->pickColor(12, 1));
|
||||
|
||||
$image = $this->createTestImage(16, 16)->fill('f00');
|
||||
$image->modify(new ResizeCanvasModifier(32, 32, '00f5', 'center'));
|
||||
$this->assertEquals(32, $image->width());
|
||||
$this->assertEquals(32, $image->height());
|
||||
$this->assertColor(0, 0, 255, 77, $image->pickColor(5, 5));
|
||||
$this->assertColor(0, 0, 255, 77, $image->pickColor(16, 5));
|
||||
$this->assertColor(0, 0, 255, 77, $image->pickColor(30, 5));
|
||||
$this->assertColor(0, 0, 255, 77, $image->pickColor(5, 16));
|
||||
$this->assertColor(255, 0, 0, 255, $image->pickColor(16, 16));
|
||||
$this->assertColor(0, 0, 255, 77, $image->pickColor(30, 16));
|
||||
$this->assertColor(0, 0, 255, 77, $image->pickColor(5, 30));
|
||||
$this->assertColor(0, 0, 255, 77, $image->pickColor(16, 30));
|
||||
$this->assertColor(0, 0, 255, 77, $image->pickColor(30, 30));
|
||||
}
|
||||
|
||||
public function testModifyEdge(): void
|
||||
|
Reference in New Issue
Block a user