mirror of
https://github.com/Intervention/image.git
synced 2025-08-01 11:30:16 +02:00
Merge pull request #335 from Sm0ke0ut/master
lowered the resource usage of GetSizeCommand() which fixes some odd Imag...
This commit is contained in:
@@ -14,11 +14,12 @@ class GetSizeCommand extends \Intervention\Image\Commands\AbstractCommand
|
||||
*/
|
||||
public function execute($image)
|
||||
{
|
||||
$info = $image->getCore()->identifyImage();
|
||||
/** @var \Imagick $core */
|
||||
$core = $image->getCore();
|
||||
|
||||
$this->setOutput(new Size(
|
||||
$info['geometry']['width'],
|
||||
$info['geometry']['height']
|
||||
$core->getImageWidth(),
|
||||
$core->getImageHeight()
|
||||
));
|
||||
|
||||
return true;
|
||||
|
@@ -9,7 +9,7 @@ class GetSizeCommandTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
Mockery::close();
|
||||
}
|
||||
|
||||
|
||||
public function testGd()
|
||||
{
|
||||
$resource = imagecreatefromjpeg(__DIR__.'/images/test.jpg');
|
||||
@@ -25,7 +25,8 @@ class GetSizeCommandTest extends PHPUnit_Framework_TestCase
|
||||
public function testImagick()
|
||||
{
|
||||
$imagick = Mockery::mock('Imagick');
|
||||
$imagick->shouldReceive('identifyimage')->with();
|
||||
$imagick->shouldReceive('getimagewidth')->with();
|
||||
$imagick->shouldReceive('getimageheight')->with();
|
||||
$image = Mockery::mock('Intervention\Image\Image');
|
||||
$image->shouldReceive('getCore')->once()->andReturn($imagick);
|
||||
$command = new GetSizeImagick(array());
|
||||
|
Reference in New Issue
Block a user