]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
SVG files can be used as thumbnails I guess
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 5 Mar 2015 10:59:11 +0000 (11:59 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 5 Mar 2015 10:59:11 +0000 (11:59 +0100)
lib/imagefile.php

index ba7e428f6d38352de03e60190c1d0c90f2f30ccc..7a545ad09302ce6117bef7f73c5ac4063da2da4f 100644 (file)
@@ -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();