check file formato on get_pdf_cover method

This commit is contained in:
Leo Germani 2018-05-06 17:57:26 -03:00
parent 949493d61f
commit 0ea6d5d0ad
1 changed files with 4 additions and 0 deletions

View File

@ -105,6 +105,10 @@ class Media {
return null;
}
if ( mime_content_type($filepath) != 'application/pdf') {
return null;
}
$imagick = new \Imagick($filepath);
$imagick->setIteratorIndex(0);
$imagick->setImageFormat('jpg');