Skip to content
Snippets Groups Projects
Commit 28cf63d3 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

check if imagick is loaded in office.php, not in libreoffice-cl.php

parent 2ff97917
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,6 @@
namespace OC\Preview;
//we need imagick to convert
if (extension_loaded('imagick')) {
class Office extends Provider {
private $cmd;
......@@ -47,9 +45,7 @@ if (extension_loaded('imagick')) {
unlink($abspath);
unlink($abspath . '.pdf');
if (!$image->valid()) return false;
return $image;
return $image->valid() ? $image : false;
}
private function initCmd() {
......@@ -74,7 +70,6 @@ if (extension_loaded('imagick')) {
$this->cmd = $cmd;
}
}
}
//.doc, .dot
class MSOfficeDoc extends Office {
......
......@@ -5,6 +5,8 @@
* later.
* See the COPYING-README file.
*/
//both, libreoffice backend and php fallback, need imagick
if (extension_loaded('imagick')) {
//let's see if there is libreoffice or openoffice on this machine
if(shell_exec('libreoffice --headless --version') || shell_exec('openoffice --headless --version') || is_string(\OC_Config::getValue('preview_libreoffice_path', null))) {
require_once('libreoffice-cl.php');
......@@ -13,3 +15,4 @@ if(shell_exec('libreoffice --headless --version') || shell_exec('openoffice --he
require_once('msoffice.php');
require_once('opendocument.php');
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment