summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2014-02-04 12:59:14 +0100
committerGeorg Ehrke <developer@georgehrke.com>2014-02-04 12:59:14 +0100
commitd55ef442cd861d04b9ccfd4493aedf0c9a4164ff (patch)
treee335065d3e4b8a809877e80ed9d2066db1731114 /lib
parent49f0f9f2f67c3494628f14c7a5c383596879ec12 (diff)
downloadnextcloud-server-d55ef442cd861d04b9ccfd4493aedf0c9a4164ff.tar.gz
nextcloud-server-d55ef442cd861d04b9ccfd4493aedf0c9a4164ff.zip
properly check if pdf and svg modules are installed
Diffstat (limited to 'lib')
-rw-r--r--lib/private/preview/office.php2
-rw-r--r--lib/private/preview/pdf.php2
-rw-r--r--lib/private/preview/svg.php2
-rw-r--r--lib/private/preview/unknown.php2
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/preview/office.php b/lib/private/preview/office.php
index 7a4826c76ec..884b6e7dc9b 100644
--- a/lib/private/preview/office.php
+++ b/lib/private/preview/office.php
@@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
//both, libreoffice backend and php fallback, need imagick
-if (extension_loaded('imagick')) {
+if (extension_loaded('imagick') && count(\Imagick::queryFormats("PDF")) === 1) {
$isShellExecEnabled = \OC_Helper::is_function_enabled('shell_exec');
// LibreOffice preview is currently not supported on Windows
diff --git a/lib/private/preview/pdf.php b/lib/private/preview/pdf.php
index cc974b68818..572b8788ac9 100644
--- a/lib/private/preview/pdf.php
+++ b/lib/private/preview/pdf.php
@@ -7,7 +7,7 @@
*/
namespace OC\Preview;
-if (extension_loaded('imagick')) {
+if (extension_loaded('imagick') && count(\Imagick::queryFormats("PDF")) === 1) {
class PDF extends Provider {
diff --git a/lib/private/preview/svg.php b/lib/private/preview/svg.php
index b49e51720fa..07a37e8f8c1 100644
--- a/lib/private/preview/svg.php
+++ b/lib/private/preview/svg.php
@@ -7,7 +7,7 @@
*/
namespace OC\Preview;
-if (extension_loaded('imagick')) {
+if (extension_loaded('imagick') && count(\Imagick::queryFormats("SVG")) === 1) {
class SVG extends Provider {
diff --git a/lib/private/preview/unknown.php b/lib/private/preview/unknown.php
index 4747f9e25ed..8145c826149 100644
--- a/lib/private/preview/unknown.php
+++ b/lib/private/preview/unknown.php
@@ -22,7 +22,7 @@ class Unknown extends Provider {
$svgPath = substr_replace($path, 'svg', -3);
- if (extension_loaded('imagick') && file_exists($svgPath)) {
+ if (extension_loaded('imagick') && file_exists($svgPath) && count(\Imagick::queryFormats("SVG")) === 1) {
// http://www.php.net/manual/de/imagick.setresolution.php#85284
$svg = new \Imagick();