mirror of
https://github.com/Intervention/image.git
synced 2025-08-10 16:04:04 +02:00
changed Imagick method of resizeCommand
This commit is contained in:
@@ -20,7 +20,7 @@ class ResizeCommand extends \Intervention\Image\Commands\AbstractCommand
|
|||||||
$resized = $image->getSize()->resize($width, $height, $constraints);
|
$resized = $image->getSize()->resize($width, $height, $constraints);
|
||||||
|
|
||||||
// modify image
|
// modify image
|
||||||
$image->getCore()->resizeImage($resized->getWidth(), $resized->getHeight(), \Imagick::FILTER_BOX, 1);
|
$image->getCore()->scaleImage($resized->getWidth(), $resized->getHeight());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ class HeightenCommandTest extends PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$callback = function ($constraint) { $constraint->upsize(); };
|
$callback = function ($constraint) { $constraint->upsize(); };
|
||||||
$imagick = Mockery::mock('Imagick');
|
$imagick = Mockery::mock('Imagick');
|
||||||
$imagick->shouldReceive('resizeimage')->with(300, 200, \Imagick::FILTER_BOX, 1)->once()->andReturn(true);
|
$imagick->shouldReceive('scaleimage')->with(300, 200)->once()->andReturn(true);
|
||||||
$size = Mockery::mock('Intervention\Image\Size', array(800, 600));
|
$size = Mockery::mock('Intervention\Image\Size', array(800, 600));
|
||||||
$size->shouldReceive('resize')->once()->andReturn($size);
|
$size->shouldReceive('resize')->once()->andReturn($size);
|
||||||
$size->shouldReceive('getWidth')->once()->andReturn(300);
|
$size->shouldReceive('getWidth')->once()->andReturn(300);
|
||||||
|
@@ -33,7 +33,7 @@ class resizeCommandTest extends PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$callback = function ($constraint) { $constraint->upsize(); };
|
$callback = function ($constraint) { $constraint->upsize(); };
|
||||||
$imagick = Mockery::mock('Imagick');
|
$imagick = Mockery::mock('Imagick');
|
||||||
$imagick->shouldReceive('resizeimage')->with(300, 200, \Imagick::FILTER_BOX, 1)->once()->andReturn(true);
|
$imagick->shouldReceive('scaleimage')->with(300, 200)->once()->andReturn(true);
|
||||||
$size = Mockery::mock('Intervention\Image\Size', array(800, 600));
|
$size = Mockery::mock('Intervention\Image\Size', array(800, 600));
|
||||||
$size->shouldReceive('resize')->with(300, 200, $callback)->once()->andReturn($size);
|
$size->shouldReceive('resize')->with(300, 200, $callback)->once()->andReturn($size);
|
||||||
$size->shouldReceive('getWidth')->once()->andReturn(300);
|
$size->shouldReceive('getWidth')->once()->andReturn(300);
|
||||||
|
@@ -33,7 +33,7 @@ class WidenCommandTest extends PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$callback = function ($constraint) { $constraint->upsize(); };
|
$callback = function ($constraint) { $constraint->upsize(); };
|
||||||
$imagick = Mockery::mock('Imagick');
|
$imagick = Mockery::mock('Imagick');
|
||||||
$imagick->shouldReceive('resizeimage')->with(300, 200, \Imagick::FILTER_BOX, 1)->once()->andReturn(true);
|
$imagick->shouldReceive('scaleimage')->with(300, 200)->once()->andReturn(true);
|
||||||
$size = Mockery::mock('Intervention\Image\Size', array(800, 600));
|
$size = Mockery::mock('Intervention\Image\Size', array(800, 600));
|
||||||
$size->shouldReceive('resize')->once()->andReturn($size);
|
$size->shouldReceive('resize')->once()->andReturn($size);
|
||||||
$size->shouldReceive('getWidth')->once()->andReturn(300);
|
$size->shouldReceive('getWidth')->once()->andReturn(300);
|
||||||
|
Reference in New Issue
Block a user