1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-01 11:30:16 +02:00

Change Imagick method for fitCommand

This commit is contained in:
Alexey Ashurok
2015-06-09 17:06:06 +06:00
parent f388f8cbde
commit ff56745b37
2 changed files with 3 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ class FitCommand extends \Intervention\Image\Commands\AbstractCommand
);
// resize image
$image->getCore()->resizeImage($resized->getWidth(), $resized->getHeight(), \Imagick::FILTER_BOX, 1);
$image->getCore()->scaleImage($resized->getWidth(), $resized->getHeight());
$image->getCore()->setImagePage(0,0,0,0);
return true;

View File

@@ -59,7 +59,7 @@ class FitCommandTest extends PHPUnit_Framework_TestCase
$original_size->shouldReceive('fit')->with(Mockery::any(), 'center')->once()->andReturn($cropped_size);
$imagick = Mockery::mock('Imagick');
$imagick->shouldReceive('cropimage')->with(800, 400, 0, 100)->andReturn(true);
$imagick->shouldReceive('resizeimage')->with(200, 100, \Imagick::FILTER_BOX, 1)->andReturn(true);
$imagick->shouldReceive('scaleimage')->with(200, 100)->once()->andReturn(true);
$imagick->shouldReceive('setimagepage')->with(0, 0, 0, 0)->andReturn(true);
$image = Mockery::mock('Intervention\Image\Image');
$image->shouldReceive('getSize')->once()->andReturn($original_size);
@@ -80,7 +80,7 @@ class FitCommandTest extends PHPUnit_Framework_TestCase
$original_size->shouldReceive('fit')->with(Mockery::any(), 'top-left')->once()->andReturn($cropped_size);
$imagick = Mockery::mock('Imagick');
$imagick->shouldReceive('cropimage')->with(800, 400, 0, 100)->andReturn(true);
$imagick->shouldReceive('resizeimage')->with(200, 100, \Imagick::FILTER_BOX, 1)->andReturn(true);
$imagick->shouldReceive('scaleimage')->with(200, 100)->once()->andReturn(true);
$imagick->shouldReceive('setimagepage')->with(0, 0, 0, 0)->andReturn(true);
$image = Mockery::mock('Intervention\Image\Image');
$image->shouldReceive('getSize')->once()->andReturn($original_size);