[Pkg-owncloud-commits] [owncloud] 18/90: remove ugly hack and don't use OC\Preview\Image for tiffs and svgs

David Prévot taffit at moszumanska.debian.org
Fri Feb 6 21:10:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 5fd1d54607dc5ba8b6e54bdf175288ca2534471a
Author: Georg Ehrke <developer at georgehrke.com>
Date:   Sun Nov 23 19:11:03 2014 +0100

    remove ugly hack and don't use OC\Preview\Image for tiffs and svgs
---
 lib/private/preview.php       | 10 ----------
 lib/private/preview/image.php |  2 +-
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/lib/private/preview.php b/lib/private/preview.php
index 907bef9..a0f2e81 100644
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -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;
diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php
index cec5d7c..c5f566a 100644
--- a/lib/private/preview/image.php
+++ b/lib/private/preview/image.php
@@ -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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list