Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
cebfdd87
Commit
cebfdd87
authored
Nov 24, 2014
by
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/private/preview.php
View file @
cebfdd87
...
...
@@ -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
;
...
...
lib/private/preview/image.php
View file @
cebfdd87
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment