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." - ); - } - } }