mirror of
https://github.com/Intervention/image.git
synced 2025-08-22 13:32:56 +02:00
bugfix
This commit is contained in:
@@ -1868,6 +1868,9 @@ class Image
|
||||
private function cloneResource($resource)
|
||||
{
|
||||
$clone = imagecreatetruecolor($this->width, $this->height);
|
||||
imagealphablending($clone, false);
|
||||
imagesavealpha($clone, true);
|
||||
|
||||
imagecopy($clone, $resource, 0, 0, 0, 0, $this->width, $this->height);
|
||||
|
||||
return $clone;
|
||||
|
@@ -1489,6 +1489,15 @@ class ImageTest extends PHPUnit_Framework_Testcase
|
||||
$this->assertEquals('#00ff00', $img->pickColor(0, 0, 'hex'));
|
||||
}
|
||||
|
||||
public function testBackupKeepTransparency($value='')
|
||||
{
|
||||
$img = new Image('public/circle.png');
|
||||
$img->backup();
|
||||
$img->reset();
|
||||
$transparent = array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0.0);
|
||||
$this->assertEquals($transparent, $img->pickColor(0, 0, 'array'));
|
||||
}
|
||||
|
||||
public function testLimitColors()
|
||||
{
|
||||
// reduce colors
|
||||
|
Reference in New Issue
Block a user