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:
parent
5078572a9a
commit
a1d34b2a4f
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user