1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 20:28:21 +01:00

switched to resizing filter box

This commit is contained in:
Oliver Vogel 2014-05-12 18:53:44 +02:00
parent 5078572a9a
commit a1d34b2a4f
6 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ class FitCommand extends \Intervention\Image\Commands\AbstractCommand
);
// resize image
$image->getCore()->resizeImage($width, $height, \Imagick::FILTER_CATROM, 1);
$image->getCore()->resizeImage($width, $height, \Imagick::FILTER_BOX, 1);
$image->getCore()->setImagePage(0,0,0,0);
return true;

View File

@ -14,7 +14,7 @@ class ResizeCommand extends \Intervention\Image\Commands\AbstractCommand
$resized = $image->getSize()->resize($width, $height, $constraints);
// modify image
$image->getCore()->resizeImage($resized->getWidth(), $resized->getHeight(), \Imagick::FILTER_CATROM, 1);
$image->getCore()->resizeImage($resized->getWidth(), $resized->getHeight(), \Imagick::FILTER_BOX, 1);
return true;
}

View File

@ -36,7 +36,7 @@ class FitCommandTest extends PHPUnit_Framework_TestCase
$original_size->shouldReceive('fit')->once()->andReturn($fitted_size);
$imagick = Mockery::mock('Imagick');
$imagick->shouldReceive('cropimage')->with(800, 400, 0, 100)->andReturn(true);
$imagick->shouldReceive('resizeimage')->with(200, 100, \Imagick::FILTER_CATROM, 1)->andReturn(true);
$imagick->shouldReceive('resizeimage')->with(200, 100, \Imagick::FILTER_BOX, 1)->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);

View File

@ -33,7 +33,7 @@ class HeightenCommandTest extends PHPUnit_Framework_TestCase
{
$callback = function ($constraint) { $constraint->upsize(); };
$imagick = Mockery::mock('Imagick');
$imagick->shouldReceive('resizeimage')->with(300, 200, \Imagick::FILTER_CATROM, 1)->once()->andReturn(true);
$imagick->shouldReceive('resizeimage')->with(300, 200, \Imagick::FILTER_BOX, 1)->once()->andReturn(true);
$size = Mockery::mock('Intervention\Image\Size', array(800, 600));
$size->shouldReceive('resize')->once()->andReturn($size);
$size->shouldReceive('getWidth')->once()->andReturn(300);

View File

@ -33,7 +33,7 @@ class resizeCommandTest extends PHPUnit_Framework_TestCase
{
$callback = function ($constraint) { $constraint->upsize(); };
$imagick = Mockery::mock('Imagick');
$imagick->shouldReceive('resizeimage')->with(300, 200, \Imagick::FILTER_CATROM, 1)->once()->andReturn(true);
$imagick->shouldReceive('resizeimage')->with(300, 200, \Imagick::FILTER_BOX, 1)->once()->andReturn(true);
$size = Mockery::mock('Intervention\Image\Size', array(800, 600));
$size->shouldReceive('resize')->with(300, 200, $callback)->once()->andReturn($size);
$size->shouldReceive('getWidth')->once()->andReturn(300);

View File

@ -33,7 +33,7 @@ class WidenCommandTest extends PHPUnit_Framework_TestCase
{
$callback = function ($constraint) { $constraint->upsize(); };
$imagick = Mockery::mock('Imagick');
$imagick->shouldReceive('resizeimage')->with(300, 200, \Imagick::FILTER_CATROM, 1)->once()->andReturn(true);
$imagick->shouldReceive('resizeimage')->with(300, 200, \Imagick::FILTER_BOX, 1)->once()->andReturn(true);
$size = Mockery::mock('Intervention\Image\Size', array(800, 600));
$size->shouldReceive('resize')->once()->andReturn($size);
$size->shouldReceive('getWidth')->once()->andReturn(300);