diff --git a/src/Intervention/Image/Imagick/Commands/GetSizeCommand.php b/src/Intervention/Image/Imagick/Commands/GetSizeCommand.php index 73f712fa..f0c09af6 100644 --- a/src/Intervention/Image/Imagick/Commands/GetSizeCommand.php +++ b/src/Intervention/Image/Imagick/Commands/GetSizeCommand.php @@ -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; diff --git a/tests/GetsizeCommandTest.php b/tests/GetsizeCommandTest.php index dc5e96e9..3efffa95 100644 --- a/tests/GetsizeCommandTest.php +++ b/tests/GetsizeCommandTest.php @@ -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());