From 2a851b4a161d352f473f89b4264385e855bd3382 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Tue, 13 May 2014 17:36:09 +0200 Subject: [PATCH] replaced own getMime with finfo --- src/Intervention/Image/Imagick/Source.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/Intervention/Image/Imagick/Source.php b/src/Intervention/Image/Imagick/Source.php index 4b49543f..d9b51fe2 100644 --- a/src/Intervention/Image/Imagick/Source.php +++ b/src/Intervention/Image/Imagick/Source.php @@ -57,23 +57,8 @@ class Source extends \Intervention\Image\AbstractSource // build image $image = $this->initFromImagick($core); - $image->mime = $this->getMime($core); + $image->mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $binary); return $image; } - - private function getMime(\Imagick $core) - { - $info = $core->identifyImage(true); - - if (preg_match("/Mime type: (?P[-\w+]+\/[-\w+]+)/", $info['rawOutput'], $match)) { - - return $match['mime']; - - } else { - throw new \Intervention\Image\Exception\RuntimeException( - "Mime type could not be extracted from image." - ); - } - } }