Skip to content
Snippets Groups Projects
Commit cebfdd87 authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Merge pull request #12372 from owncloud/preview_tiff_fix

remove ugly hack and don't use OC\Preview\Image for tiffs and svgs
parents a3496cf7 45d985f2
No related branches found
No related tags found
No related merge requests found
......@@ -892,16 +892,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;
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment