]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove ugly hack and don't use OC\Preview\Image for tiffs and svgs
authorGeorg Ehrke <developer@georgehrke.com>
Sun, 23 Nov 2014 18:11:03 +0000 (19:11 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Fri, 12 Dec 2014 07:30:17 +0000 (08:30 +0100)
lib/private/preview.php
lib/private/preview/image.php

index 907bef923b5f63d16d237dec61020b34991e5342..a0f2e81528f9b9bec3377521becc9a9df7090e55 100644 (file)
@@ -855,16 +855,6 @@ class Preview {
                        self::initProviders();
                }
 
-               // FIXME: Ugly hack to prevent SVG of being returned if the SVG
-               // provider is not enabled.
-               // This is required because the preview system is designed in a
-               // bad way and relies on opt-in with asterisks (i.e. image/*)
-               // which will lead to the fact that a SVG will also match the image
-               // provider.
-               if($mimeType === 'image/svg+xml' && !array_key_exists('/image\/svg\+xml/', self::$providers)) {
-                       return false;
-               }
-
                foreach(self::$providers as $supportedMimetype => $provider) {
                        if(preg_match($supportedMimetype, $mimeType)) {
                                return true;
index cec5d7c0170182d17cf15e1c95ac75f4f8b96420..c5f566aa946b98cee19b13bdf10f4827511e5b2b 100644 (file)
@@ -11,7 +11,7 @@ namespace OC\Preview;
 class Image extends Provider {
 
        public function getMimeType() {
-               return '/image\/.*/';
+               return '/image\/(?!tiff$)(?!svg.*).*/';
        }
 
        public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {