1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-01 09:52:59 +02:00

replaced deprecated methods

This commit is contained in:
Oliver Vogel
2014-05-13 17:42:12 +02:00
parent 2a851b4a16
commit ce66ea8560
6 changed files with 7 additions and 7 deletions

View File

@@ -37,7 +37,7 @@ class FillCommand extends \Intervention\Image\Commands\AbstractCommand
$tile = clone $image->getCore();
// mask away color at position
$tile->paintTransparentImage($tile->getImagePixelColor($x, $y), 0, 0);
$tile->transparentPaintImage($tile->getImagePixelColor($x, $y), 0, 0, false);
// create canvas
$canvas = clone $image->getCore();
@@ -62,7 +62,7 @@ class FillCommand extends \Intervention\Image\Commands\AbstractCommand
$tile = clone $image->getCore();
// mask away color at pos.
$tile->paintTransparentImage($tile->getImagePixelColor($x, $y), 0, 0);
$tile->transparentPaintImage($tile->getImagePixelColor($x, $y), 0, 0, false);
// save alpha channel of original image
$alpha = clone $image->getCore();

View File

@@ -15,7 +15,7 @@ class LimitColorsCommand extends \Intervention\Image\Commands\AbstractCommand
// build 2 color alpha mask from original alpha
$alpha = clone $image->getCore();
$alpha->separateImageChannel(\Imagick::CHANNEL_ALPHA);
$alpha->paintTransparentImage('#ffffff', 0, 0);
$alpha->transparentPaintImage('#ffffff', 0, 0, false);
$alpha->separateImageChannel(\Imagick::CHANNEL_ALPHA);
$alpha->negateImage(false);

View File

@@ -66,7 +66,7 @@ class ResizeCanvasCommand extends \Intervention\Image\Commands\AbstractCommand
$rect->setFillColor($fill);
$rect->rectangle($dst_x, $dst_y, $dst_x + $src_w - 1, $dst_y + $src_h - 1);
$canvas->getCore()->drawImage($rect);
$canvas->getCore()->paintTransparentImage($fill, 0, 0);
$canvas->getCore()->transparentPaintImage($fill, 0, 0, false);
// copy image into new canvas
$image->getCore()->cropImage($src_w, $src_h, $src_x, $src_y);

View File

@@ -55,7 +55,7 @@ class FillCommandTest extends PHPUnit_Framework_TestCase
{
$imagick = Mockery::mock('Imagick');
$imagick->shouldReceive('getimagepixelcolor')->once()->andReturn('#000000');
$imagick->shouldReceive('painttransparentimage')->once()->andReturn(true);
$imagick->shouldReceive('transparentpaintimage')->once()->andReturn(true);
$imagick->shouldReceive('compositeimage')->times(3)->andReturn(true);
$image = Mockery::mock('Intervention\Image\Image');
$image->shouldReceive('getCore')->andReturn($imagick);

View File

@@ -28,7 +28,7 @@ class LimitColorsCommandTest extends PHPUnit_Framework_TestCase
$size = Mockery::mock('\Intervention\Image\Size', array(32, 32));
$imagick = Mockery::mock('\Imagick');
$imagick->shouldReceive('separateimagechannel')->with(\Imagick::CHANNEL_ALPHA)->times(2);
$imagick->shouldReceive('painttransparentimage')->with('#ffffff', 0, 0)->once();
$imagick->shouldReceive('transparentpaintimage')->with('#ffffff', 0, 0, false)->once();
$imagick->shouldReceive('negateimage')->with(false)->once();
$imagick->shouldReceive('quantizeimage')->with(16, \Imagick::COLORSPACE_RGB, 0, false, false)->once();
$imagick->shouldReceive('compositeimage')->once();

View File

@@ -55,7 +55,7 @@ class ResizeCanvasCommandTest extends PHPUnit_Framework_TestCase
$imagick->shouldReceive('compositeimage')->with($imagick, 40, 0, 0)->once();
$imagick->shouldReceive('setimagepage')->with(0, 0, 0, 0)->once();
$imagick->shouldReceive('drawimage')->once();
$imagick->shouldReceive('painttransparentimage')->once();
$imagick->shouldReceive('transparentpaintimage')->once();
$canvas->shouldReceive('getCore')->times(5)->andReturn($imagick);
$canvas->shouldReceive('getSize')->andReturn($canvas_size);