From: Mikael Nordfeldth Date: Thu, 5 Mar 2015 10:59:11 +0000 (+0100) Subject: SVG files can be used as thumbnails I guess X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3755faf5580d3b13103fc0d215f6d588403a16bf;p=quix0rs-gnu-social.git SVG files can be used as thumbnails I guess --- 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();