From 3755faf5580d3b13103fc0d215f6d588403a16bf Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 5 Mar 2015 11:59:11 +0100 Subject: [PATCH] SVG files can be used as thumbnails I guess --- lib/imagefile.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/imagefile.php b/lib/imagefile.php index ba7e428f6d..7a545ad093 100644 --- a/lib/imagefile.php +++ b/lib/imagefile.php @@ -128,6 +128,14 @@ class ImageFile if (empty($file->filename)) { throw new UnsupportedMediaException(_('File without filename could not get a thumbnail source.')); } + + // First some mimetype specific exceptions + switch ($file->mimetype) { + case 'image/svg+xml': + throw new UseFileAsThumbnailException($file->id); + } + + // And we'll only consider it an image if it has such a media type switch ($media) { case 'image': $imgPath = $file->getPath(); -- 2.39.2